#2019-01-2708:06cflemingIt is new though, so there may well be bugs 🙂#2019-01-2720:45WhoNeedszZzOk well that's good to know. @U0GC1C09L What's so special about deps.edn that Leiningen doesn't do?#2019-01-2722:58joshkh@UAFT1B7Q8 i like the ability to point to a git sha as a dependency (say on github) rather than a package tagged with a version number. deps.edn also makes it easier to work on multiple projects at the same time. i don't have to lein install them over and over as i make updates. also, aliases are really powerful. for example, i can launch my project in different ways for testing, or automate my deployments.#2019-01-2723:00joshkhit's fast, lightweight, and with aliases i get the parts i need automate stuff. lein or boot can do that, of course, but in my experience it takes a little more effort.#2019-01-2723:26WhoNeedszZzInteresting. What exactly do you mean about multiple projects at the same time? From what I'm seeing aliases are the same as profiles in Leiningen.#2019-01-2704:09cfleming@joshkh Is that Clojure or CLJS? When you look at File->Project Structure->Modules->[your module] under the Dependencies tab, is Clojure (or CLJS if that’s what you’re using) there as a dependency?#2019-01-2704:09cflemingWhat is the error you get when reimporting?#2019-01-2706:50joshkhso clojure core functions started working again after another reimport, however third party clojurescript functions were still undefined. i think i figured it out though: the cljs libraries are :extra-deps in a clojure alias. moving them to the main :deps key makes intellij happy again.#2019-01-2707:02joshkhand indeed, deps in :extra-deps do not appear in File->Project Structure->Modules->[your module]->Dependencies#2019-01-2708:05cfleming@joshkh Go to the deps toolwindow and open the Aliases tree, check the aliases that those deps are under and then they’ll be used when syncing with Cursive.#2019-01-2708:08joshkhperfect. thanks so much for the help.#2019-01-2708:13joshkhi must have scanned over that toolbar a million times without even noticing it 🙂#2019-01-2708:24joshkhwhile i'm here, another (unrelated) question! sometimes i change my mind about a package name. when i right click say src/clj/package1, select Refactor > Rename, and do the refactor, none of the namespaces are updated -- only the package (folder) name. is that the expected behaviour?#2019-01-2720:02Lennart BuitCan cursive be configured to insert a newline after (:require in ns declarations? Makes sorting requires easier and diffs clearer ^^.#2019-01-2720:46WhoNeedszZzWhat's stopping you from doing this? If you put your first require like that then the rest will follow suit#2019-01-2720:48Lennart BuitTrue, I’d like it to be by default tho#2019-01-2720:07Lennart BuitSo I would prefer this:
(ns my-awesome-ns
(:require
[some-lesser-ns]
[some-other-lesser-ns]))
#2019-01-2811:06leenaHi, IntellijIdea and Cursive users, how do you make Idea to recognise HugSQL functions?#2019-01-2820:46seriogaI declare them in corresponding namespace. #2019-01-2820:49seriogaAlso in latest projects I use custom macro to generate functions from multiple sql files (one file is one function) and resolve this macro as declare.#2019-01-2814:56scarytomI'm using "run tests in current NS in repl" to run my tests, but when I rename a test, it keeps re-running my old test unless I run a remove-ns. Is there a way to have "run tests in current NS in repl" automatically remove-ns before it runs? I think this is probably the least surprising behaviour.#2019-01-2820:46seriogaI declare them in corresponding namespace. #2019-01-2820:49seriogaAlso in latest projects I use custom macro to generate functions from multiple sql files (one file is one function) and resolve this macro as declare.#2019-01-2919:29joshkhcan i use cursive to save and then paste canned code into the repl? for instance, a stub of a datomic query: (d/q '{:find [] :in [$] :where [[]]} db)#2019-01-2919:43manutter51You can do that with Live Templates (in Preferences under the Editor). Not specific to Cursive but it does work in the REPL#2019-01-2919:44cfleming@joshkh To answer your earlier question, sadly the package renaming doesn’t work correctly at the moment.#2019-01-2919:45cfleming@lennart.buit I’d have to double check, but I don’t think Cursive’s current formatting allows that, no. It’s not hard to add though.#2019-01-2920:17Lennart BuitHey, its obviously not very critical, thanks for responding tho!#2019-01-2920:25Lennart BuitIts f.e. recommended here: https://stuartsierra.com/2016/clojure-how-to-ns.html ^^#2019-01-2919:45cfleming@joshkh manutter51 is right, that sounds like a job for live templates.#2019-01-2919:46cflemingYou’ll be able to set variables in the templates to tab between etc.#2019-01-2919:49joshkhthat's okay about the package renaming. one day. 🙂 and thanks @manutter51 for the tip.#2019-01-3001:55astrasheI’m trying to import a shadow-cljs project that uses deps.edn, but I’m getting a “sync failed” message. I’m not sure what’s wrong, or what to do next.#2019-01-3002:03cfleming@astrashe Can you send a screenshot of that error?#2019-01-3002:08astrashe@cfleming Here you go, thanks#2019-01-3002:08astrashe“sync failed” message#2019-01-3002:10astrasheCould you see the file? I got a message from slack that says the workspace doesn’t have any space left#2019-01-3002:10cfleming@astrashe Interesting, I wonder if it’s just taking a long time to sync all the deps. If you do e.g. clj -Spath on the command line and then try again in Cursive, does that help?#2019-01-3002:10cflemingYes, I can - Slack complains, but it does show the files.#2019-01-3002:14astrasheclj -Spath didn’t work. The error comes back immediately — I think I’ve probably got something big misconfigured.#2019-01-3002:16cfleming@astrashe Can you send a screenshot of Settings->Build, Execution, Deployment->Build Tools->Clojure Deps?#2019-01-3002:18astrasheI think I didn’t have a clojure command specified — I put in the path, and it seems to be working#2019-01-3002:18astrashethanks!#2019-01-3002:25cfleming@astrashe Great! Which version of Cursive are you using, BTW?#2019-01-3002:36astrashe@cfleming v1.8.0-2018.3#2019-01-3002:39cfleming@astrashe Ok, thanks - the latest EAP version should have better validation for that case.#2019-01-3002:45astrasheI’ll check it out. Thanks again, it’s incredible that you’re here to help at this time of the night!#2019-01-3003:42cflemingHehe, it’s 4pm here 🙂#2019-01-3007:33gravOn latest EAP I get "Please Refresh to see available tools.deps versions" when trying to import a Module from a deps.edn#2019-01-3007:33gravDoesn't matter if I select "Use CLI tools" or "Use tools.deps directly"#2019-01-3007:34gravI've also tried "Refresh", thereafter "Download", but doesn't seem to make a difference#2019-01-3007:34gravIDEA 2018.3.2#2019-01-3007:53cfleming@grav Can you try configuring that first at Settings->Build, Execution, Deployment->Build Tools->Clojure Deps, then retrying the import? Someone reported something similar the other day.#2019-01-3009:01flowthingIf I make some changes to a source file, then execute the clojure.tools.namespace.repl/refresh function, and then run the "Run tests in current NS in REPL" command, I get an error like this:
Alias handler already exists in namespace foo.handler-test, aliasing foo.handler
I have to do something like (ns-unalias *ns* 'handler) for every namespace required in the test namespace to fix the error.
I understand why it happens, but I wonder whether there's an easier way to fix the issue?#2022-05-3108:27jaimeSorry for necroposting 😅
@cfleming Any idea why this happens and how to resolve it? I'm also getting that issue. BTW, thanks for adding the show diff KB shortcut in tests 🔥#2022-05-3108:31flowthingI avoid tools.namespace.repl these days (and don't use Cursive any more), but a couple of ideas come to mind:
• I wonder if adding your test dir into t.n.r. refresh dirs would fix the issue?
• If all else fails, you can add a custom Cursive REPL command that does (run! #(ns-unalias *ns* (first %)) (ns-aliases *ns*)), then run the tests again.#2022-05-3109:01jaimeHi @flowthing, thanks a lot for the suggestion, seems like adding the test dir works. Let's see if I'll hit the issue again. 🙏#2019-01-3019:56scarytomSounds similar to the issue I asked about the other day @flowthing https://clojurians.slack.com/archives/C0744GXCJ/p1548687418285100#2019-01-3019:56scarytomAny suggestions @cfleming?#2019-01-3023:15Peter Wilkinsdoes anyone use Cursive with Arcadia?
there is a socket and a basic nrepl: https://github.com/arcadia-unity/Arcadia/wiki/REPL#editor-integration
I had a punt at connecting with remote repl but got TypeNotFoundException: Unable to find type: cursive.repl.runtime
I'm happy to work on this if anyone has any pointers that can help me get started.#2019-01-3100:45tanzoniteblackIs it possible to ask cursive to align the args to condp?#2019-01-3108:25odinodinIs there a way to align map values in a selection without having to globally change the code style setting?#2019-01-3108:33cfleming@flowthing @t.denley Yes, I wonder if Cursive should behave more like tools.namespace and properly blow the namespaces away before reloading them.#2019-01-3110:12scarytomMaybe, although you might not want to blow away a namespace a user has been adding to in the repl. In my specific case, just blowing away all the deftests would be ideal.#2019-01-3110:18flowthingThe deftests and the namespaces required by the test namespace we're running "Run tests in current NS in REPL" in, I suppose. Although don't know whether that's possible.#2019-01-3108:34cfleming@poppetew Not that I’m aware of. Unfortunately it’s hard to support Unity since IntelliJ has no CLR knowledge, and Rider works in a totally different way to IntelliJ so it would be a large rewrite.#2019-01-3108:34cfleming@tanzoniteblack Not at the moment, sorry.#2019-01-3108:35cfleming@odinodin Also no, sorry, although that’s something that several people have asked for.#2019-01-3110:12scarytomMaybe, although you might not want to blow away a namespace a user has been adding to in the repl. In my specific case, just blowing away all the deftests would be ideal.#2019-01-3116:34nblumoeHey, is there any way to get output from a form sent to the REPL pasted to the editor other than manually copying it from the REPL. Ideally having a comment added after the form with the return value / output#2019-01-3117:59bherrmannI use this sometimes to copy from a REPL to the cut/paste buffer... saves 1 step. Useful if you build up a big wiki table and need to move it into the wiki via the browser ....#2019-01-3117:59bherrmann(defn to-clipboard [^String jj]
(.setContents (.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit)) (java.awt.datatransfer.StringSelection. jj) nil)
)#2019-02-0116:05kennyI'm running into a pretty nasty IntelliJ/Cursive bug. I am editing a deftype when I get an IDE error (I submitted one to Cursive, I think). Then a couple seconds later I get a IDE and Plugin Updates message. A couple seconds after that, I can no longer edit my file or close IntelliJ. I have to log out and log back in to get IntelliJ to quit.#2019-02-0116:06kennyThe deftype looks like this:
(deftype PointTimestampExtractor []
TimestampExtractor
(^long extract [_ ^ConsumerRecord record ^long previousTimeStamp]
(let [{:keys [point]} (.value record)]
(long (first point)))))
#2019-02-0116:07manutter51Sounds nasty, have you tried File->Invalidate Caches & Restart...?#2019-02-0116:07kennyNo. Not sure how that would help here. It isn't a problem with resolving stuff. I guess I could try it though.#2019-02-0116:08manutter51I'm just thinking it sounds like something is majorly corrupted somewhere, cache clearing might help? 🤞#2019-02-0116:08kennyTrying now 🙂#2019-02-0116:08kennyI think I've had problems with editing deftypes in the past too. None that cause a full editor crash like this though.#2019-02-0116:10Alex Miller (Clojure team)that ^long return type looks wrong#2019-02-0116:11kennyWhere should it go?#2019-02-0116:11Alex Miller (Clojure team)nowhere#2019-02-0116:11Alex Miller (Clojure team)the signature of extract is defined in TimestampExtractor - that’s what you’re going to get#2019-02-0116:11kennyRight, makes sense. Maybe that's causing an issue.#2019-02-0116:12Alex Miller (Clojure team)the type hints in the signature won’t affect the method signature (again, you’ll get whatever extract is defined as) but do help the interop inside the method#2019-02-0116:13Alex Miller (Clojure team)although I guess previousTimeStamp isn’t being used, so not gaining anything there#2019-02-0116:13kennyTBH it's mostly helpful for documentation.#2019-02-0116:14Alex Miller (Clojure team)fair enough#2019-02-0116:17kennyIt just happened again - after Invalidate caches & fixing that type hint. The exception reported says it is #131. This time no IDE crash but editing in and around the deftypes acts very strangely. For example, if I put my cursor at the end of the deftype and hit enter, it will indent to the starting paren here (long.#2019-02-0116:18kennyBackspace doesn't work around the deftypes either.#2019-02-0116:19kennyOpening and closing the file doesn't help. Editing anything above the deftype form but below the form above the deftype and anything below the deftype form but above the form below it causes the strange indent & no backspace issue.#2019-02-0116:21kennyClosing and reopening the project doesn't help. Even restarting the IDE doesn't do it.#2019-02-0118:12joelsanchezis there any refactor for moving vars in cursive?#2019-02-0119:51cfleming@kenny That does sound nasty, sorry - I’ve looked at the error, it’s a StackOverflowError. I can’t immediately see the cause, sorry. The class definition code did change in the latest EAP, downgrading to the latest stable might help until I can look at it?#2019-02-0119:52cflemingSOEs are really nasty, they can cause the JVM to hold onto monitor objects forever and other seemingly impossible things.#2019-02-0119:55cfleming@joelsanchez No sorry, although there should be.#2019-02-0120:21joelsanchezany plans to add it? it could be like this:
- move the def to the end of target ns
- require the new ns in the namespaces that use the var (if needed), and allow the user to decide if Cursive should use a :refer or an :alias
- (possibly) remove requires of the old ns if it's not used anymore#2019-02-0221:54salami've been getting the following exception while working on a simple deps project. this happens whenever i refresh the project in the clojure deps tool window:
2019-02-02 13:38:01,570 [ 63736] WARN - nal.AbstractExternalSystemTask - clojure/java/api/Clojure
java.lang.NoClassDefFoundError: clojure/java/api/Clojure
at cursive.deps.ToolsDepsResolver.resolve(ToolsDepsResolver.kt:22)
at cursive.deps.DepsProjectResolver.resolveProjectInfo(DepsSupport.kt:292)
at cursive.deps.DepsProjectResolver.resolveProjectInfo(DepsSupport.kt:259)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(RemoteExternalSystemProjectResolverImpl.java:37)
at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:58)
at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.openapi.externalSystem.service.RemoteExternalSystemFacadeImpl$1.invoke(RemoteExternalSystemFacadeImpl.java:115)
at com.sun.proxy.$Proxy3.resolveProjectInfo(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
a direct consequence, i suspect, of this is that java class imports are reported as unused and related symbols are not being properly resolved. starting repl (via clojure.main option in the run configuration) just hangs intellij idea. any thought?#2019-02-0306:40cfleming@abdusalam That’s usually because your clojure install isn’t configured correctly. Check that it all looks ok at Settings->Build, Execution and Deployment->Build Tools->Clojure Deps. When it’s properly configured there, try refreshing the project in the Deps toolwindow, hopefully that will fix the issue.#2019-02-0306:40cflemingThere’s better validation for all this in the latest EAP.#2019-02-0316:44salamhmm... the latest eap didn't make any change to the clojure dpes settings page (i took before/after screenshots and there's no difference). NoClassDefFoundError seems to be gone though. starting a repl with options "clojure.main" and "run with deps" still hangs the ide with the following log entry in idea.log:
2019-02-03 08:22:45,416 [ 342079] INFO - #cursive.shim.Shim - Bootstrap loader cannot load RT
#2019-02-0316:48salamstarting a repl with options "clojure.main" and "run with intellij classpath" hangs the ide with the following in idea.log:
2019-02-03 08:19:31,785 [ 148448] WARN - n.process.BaseOSProcessHandler - Process hasn't generated any output for a long time.
If it's a long-running mostly idle daemon process, consider overriding OSProcessHandler#readerOptions with 'BaseOutputReader.Options.forMostlySilentProcess()' to reduce CPU usage.
Command line: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b13-0.fc29.x86_64/jre/bin/java -Djava.awt.headless=true -Dsun.rmi.transport.connectionTimeout=3600000 -Dexternal.system.id=CLOJURE_DEPS -Dfile.encoding=UTF-8 -classpath /home/finalfantasia/apps/idea-IC-183.3975.18/lib/resources_en.jar:/home/finalfantasia/apps/idea-IC-183.3975.18/lib/java_resources_en.jar:/home/finalfantasia/apps/idea-IC-183.3975.18/lib/trove4j.jar:/home/finalfantasia/apps/idea-IC-183.3975.18/lib/annotations.jar:/home/finalfantasia/apps/idea-IC-183.3975.18/lib/oro-2.0.8.jar:/home/finalfantasia/apps/idea-IC-183.3975.18/lib/jna.jar:/home/finalfantasia/apps/idea-IC-183.3975.18/lib/log4j.jar:/home/finalfantasia/apps/idea-IC-183.3975.18/lib/lz4-1.3.0.jar:/home/finalfantasia/apps/idea-IC-183.3975.18/lib/jdom.jar:/home/finalfantasia/apps/idea-IC-183.3975.18/lib/jna-platform.jar:/home/finalfantasia/apps/idea-IC-183.3975.18/lib/util.jar:/home/finalfantasia/apps/idea-IC-183.3975.18/lib/platform-api.jar:/home/finalfantasia/apps/idea-IC-183.3975.18 ...
java.lang.Throwable: Process creation:
at com.intellij.execution.process.BaseOSProcessHandler.<init>(BaseOSProcessHandler.java:34)
at com.intellij.execution.process.OSProcessHandler.<init>(OSProcessHandler.java:89)
at com.intellij.execution.process.OSProcessHandler.<init>(OSProcessHandler.java:44)
at com.intellij.openapi.externalSystem.service.RemoteExternalSystemCommunicationManager$2.startProcess(RemoteExternalSystemCommunicationManager.java:195)
at com.intellij.openapi.externalSystem.service.RemoteExternalSystemCommunicationManager$2.execute(RemoteExternalSystemCommunicationManager.java:186)
at com.intellij.execution.rmi.RemoteProcessSupport.startProcess(RemoteProcessSupport.java:212)
at com.intellij.execution.rmi.RemoteProcessSupport.acquire(RemoteProcessSupport.java:139)
at com.intellij.openapi.externalSystem.service.RemoteExternalSystemCommunicationManager.acquire(RemoteExternalSystemCommunicationManager.java:210)
at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.doCreateFacade(ExternalSystemFacadeManager.java:187)
at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.doGetFacade(ExternalSystemFacadeManager.java:176)
at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager.doInvoke(ExternalSystemFacadeManager.java:132)
at com.intellij.openapi.externalSystem.service.ExternalSystemFacadeManager$MyHandler.invoke(ExternalSystemFacadeManager.java:268)
at com.sun.proxy.$Proxy79.getResolver(Unknown Source)
at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:84)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:166)
at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:152)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:554)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4.run(ExternalSystemUtil.java:650)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:727)
(log truncated due to character count limit)#2019-02-0316:49salamthe same with starting a repl with nrepl, with only the following log entry:
2019-02-03 08:38:00,313 [ 25371] INFO - #cursive.repl.nrepl - Shutting down REPL executor
#2019-02-0316:50salamvery strange...#2019-02-0316:52salamon the other hand, clj works just fine.#2019-02-0418:00gravIs there some kind of linting that will make sure Parinfer works? Currently, the indentation of team-mates both using Vim and Emacs results in Parinfer getting confused when I load up the code#2019-02-0420:41mseddon@cfleming Does cursive for Windows install a version of clj cli? Trying to isolate a report from #clj-on-windows and it sounds like they think they have an .exe installed, possibly https://github.com/frericksm/clj-windows? It is of course equally possible they installed something else on their path and forgot. #2019-02-0422:18cfleming@mseddon No, it doesn’t. If you want to use deps on Windows with Cursive right now, you use the “Use tools.deps directly” config option which uses tools.deps.alpha as a library and doesn’t use the CLI stuff at all.#2019-02-0422:19cflemingAre they using the “Use CLI tools” option pointing at the .exe?#2019-02-0509:17mseddonNo, the issue they are having is invoking the cli they (mistakenly) believed was installed by cursive from windows 🙂 Thanks#2019-02-0500:17pvillegas12For some reason, when the intellij light bulb icon appears on >defn from [ghostwheel.core :as gw :refer [>defn]]) it does not resolve it to the ghostwheel definition#2019-02-0500:17pvillegas12Does anybody know how cursive / intellj auto detect new libraries in the classpath for this?#2019-02-0500:24cfleming@pvillegas12 What do you mean by “does not resolve it to the ghostwheel definition”? What are you seeing?#2019-02-0500:25pvillegas12#2019-02-0500:25pvillegas12having required [ghostwheel.core :as gw :refer [>defn]])#2019-02-0500:26cflemingHow is >defn defined in ghostwheel.core?#2019-02-0500:26pvillegas12it is a macro which is similar to defn#2019-02-0500:26pvillegas12I want intellij to basically treat it as a defn#2019-02-0500:27cflemingYes, but how is it actually defined - is it defined using defmacro or some other macro?#2019-02-0500:27pvillegas12defmacro yes#2019-02-0500:28pvillegas12I might be lost on how to make intellij load dependencies#2019-02-0500:28pvillegas12(so that it knows how to resolve these with the lightbulb I was referring to)#2019-02-0500:28cflemingOk, one sec, I’ll try to reproduce that.#2019-02-0500:30pvillegas12yes, looks like intellij knows about ghostwheel but cannot recognize the macro >defn (even when requiring it)#2019-02-0500:33cfleming@pvillegas12 Which version of ghostwheel are you using?#2019-02-0500:33pvillegas12gnl/ghostwheel {:mvn/version "0.3.5"}#2019-02-0500:33pvillegas12using deps.edn, how do I trigger cursive to load that into the classpath?#2019-02-0500:36cflemingYou can do that from the deps toolwindow, View->Tool Windows->Clojure Deps, then press the refresh button.#2019-02-0500:37pvillegas12hmmm, that does not help with my problem#2019-02-0500:38pvillegas12I’m not seeing https://cursive-ide.com/userguide/macros.html behavior is what I’m guessing#2019-02-0500:38pvillegas12hmm, also getting weird behavior with spec, getting s/cat can be required#2019-02-0500:39cfleming#2019-02-0500:40cflemingCursive can definitely see that macro, so there must be something else going on.#2019-02-0500:41cflemingIf you open File->Project Structure, then select Modules and select your module, under Dependencies do you see gnl/ghostwheel there?#2019-02-0500:41cfleming@pvillegas12 ^^#2019-02-0500:42pvillegas12got it working @cfleming#2019-02-0500:42pvillegas12thanks for pointing me in the right direction, I forgot the (:require form… facepalm#2019-02-0500:42cflemingOoops 🙂#2019-02-0500:42cflemingThat will do it.#2019-02-0500:43pvillegas12😄#2019-02-0604:53caleb.macdonaldblackCan I eval all files in repl even if some haven't changed?#2019-02-0608:22pedrorgirardiHi @cfleming . I’m starting the REPL using the CLJ tool, but for some reason it’s not setting the clojure.libfile system property. I’m using the JUXT Kick tool and it uses that property to exclude itself from the classpath. (Running clj from the terminal sets the property.)#2019-02-0617:17Lennart BuitDoes connecting visual vm to a (cursive) repl break it? I appear to be unable to load/execute code I sent there#2019-02-0700:41cfleming@caleb.macdonaldblack I assume you mean send them to the REPL, right? Which files would you want to do that for? All open editors, all in the project, or something else?#2019-02-0700:41cfleming@pedrorgirardi I’m not familiar with Kick - how does it set that property?#2019-02-0700:41cflemingIs it set via an alias?#2019-02-0700:42cfleming@lennart.buit I haven’t used VisualVM in a while, but nothing I know of should cause that.#2019-02-0700:42caleb.macdonaldblackall in project. Cascading down based on dependency#2019-02-0700:42caleb.macdonaldblacka -> b -> c : reloading c reloads a & b also#2019-02-0700:43caleb.macdonaldblackIt's not a big deal if this isn't supported. My issue is with using 'def' anyway so it's probably poor design around that#2019-02-0700:43cflemingIn that diagram, a depends on b which depends on c, right? So you’re talking about reloading namespaces that depend on the one you’re loading?#2019-02-0700:43caleb.macdonaldblackyea#2019-02-0700:44cflemingCursive currently doesn’t do that, no, but it would be very useful in some circumstances (things like multimethods, protocol implementations etc).#2019-02-0700:44caleb.macdonaldblackI'm actually using protocols here which is contributing to this issues#2019-02-0700:45caleb.macdonaldblackand pedestal routes need to be reloaded each time#2019-02-0700:46caleb.macdonaldblackSo if i change my protocol, i need to reload the protocol ns, any ns that used that protocol, the routes ns, and finally reload start and stop component to get new instances. That final one is necessary for how protocols work, but it's quite a few steps to go through#2019-02-0700:51cflemingDoes the routes ns depend on the protocol one?#2019-02-0700:52caleb.macdonaldblackyes#2019-02-0700:53cflemingOk, so if reloading a ns also reloaded its dependent ones, then you could create a REPL command for the start/stop component, with sync files as the prior step, and I think you should be able to do the whole thing with a single key.#2019-02-0700:54caleb.macdonaldblackOh wow, I didn't know that existed#2019-02-0700:55cfleminghttps://cursive-ide.com/userguide/repl.html#repl-commands#2019-02-0700:55cflemingThat doc is slightly out of date, but you get the idea.#2019-02-0700:56cflemingThe only thing with that is that it doesn’t currently do the dependent namespace part - that would have to be a more general enhancement to the sync files functionality.#2019-02-0701:02caleb.macdonaldblackWow that repl command functionality is incredibly useful#2019-02-0701:02caleb.macdonaldblackthanks#2019-02-0701:03cflemingNo worries, I hope it helps! If you could file an issue for the dependent namespace loading, I’ll try to take a look at that soon.#2019-02-0701:03caleb.macdonaldblackAlright sounds good#2019-02-0701:40pedrorgirardiHi @cfleming. I think it’s the clj tool that sets that property. I found this http://insideclojure.org/2018/05/04/add-lib/
>System property clojure.libfile - referring to an edn file holding the lib map. clj will set this automatically for you and point to the cached lib map it’s using.#2019-02-0701:43pedrorgirardiIf I run from the terminal:
(System/getProperty "clojure.libfile") => ".cpcache/3399073160.libs"#2019-02-0701:44cfleming@pedrorgirardi How is your REPL configured - are you using the “Run with Deps” option?#2019-02-0701:45pedrorgirardiYes, using Run with Deps option.#2019-02-0701:47pedrorgirardihttps://d.pr/free/i/PMhxT4#2019-02-0701:47cflemingOk, one sec - let me check what that’s doing.#2019-02-0701:47pedrorgirardiSure. Thank you!#2019-02-0701:58cfleming@pedrorgirardi Right, so the problem is that Cursive doesn’t use the clojure command to create the classpath when running tasks, and it’s the script itself which sets that system property. However it looks like I can support that by doing the same thing that the script does, more or less.#2019-02-0702:00pedrorgirardiAh, got you.#2019-02-0702:00cflemingIf you could file an issue for that, I’ll try to fix that shortly.#2019-02-0702:00pedrorgirardiYep, will do. Thank you very much @cfleming.#2019-02-0718:29kennyI set a breakpoint in one of my dependencies and I am getting a message that says "No executable code found. " I'm running v1.8.1-eap2-2018.3. The project is a Clojure Deps project and the dep is a git dep.#2019-02-0720:03stijnHi, is it possible to use the REBL interface from a cursive REPL? I can't seem to get it to work with a clojure.main repl#2019-02-0720:26stijnoh, ok, it's explained here https://github.com/cognitect-labs/REBL-distro/wiki/REBL-in-IntelliJ-Cursive#2019-02-0720:26stijnworks! 🙂#2019-02-0720:33stijnhmm, but you cannot send code from a file to the REPL#2019-02-0720:43cfleming@stijn Thanks, I didn’t even know they had that documented!#2019-02-0720:45cfleming@kenny Hmm, that can be flakey sometimes. Can you paste a screenshot of the line the breakpoint is on with the code from that line?#2019-02-0720:46cflemingFeel free to DM me if the code is sensitive#2019-02-0721:04Bo ChenHi,
Has anyone had luck launching repls (using leiningen) with lein-shell prep-tasks, and getting the working directory set properly? E.g. This project.clj
(defproject ...
:plugins [[lein-shell "0.5.0"]]
:prep-tasks ^:replace [["shell" "./script/run_some_checks.sh"]
"javac"
"compile"]
ends up trying and failing to launch the shell script from intelliJ's working directory /Applications/IntelliJ IDEA , rather than the project home directory. The rest of the REPL is using the the project home directory correctly. (I'm using OSX)#2019-02-0721:06Bo ChenI confirmed that (System/getProperty "user.dir") is passed through as /Applications/IntelliJ IDEA to lein-shell. While in a repl launched without that prep-task, (System/getProperty "user.dir") is the project home directory.#2019-02-0722:45kenny@cfleming Here's a screenshot.#2019-02-0722:48kennyWhat is the Local REPL + Run with Deps option suppose to do? If I add an alias in that text box, it doesn't seem to get used in the REPL's CP.#2019-02-0722:54cfleming@kenny Has that namespace been loaded into the REPL?#2019-02-0722:55cflemingOften breakpoints appear like that before the namespace is actually loaded.#2019-02-0722:55cflemingThe aliases in that textbox should definitely affect the classpath, if not that’s a bug for sure.#2019-02-0723:05kennyThis dep had never been downloaded before so that could be related.#2019-02-0723:07kennyEven after downloading the dep via the CLI, it still doesn't appear in the CP. This is the alias {:oz {:extra-deps {metasoarous/oz {:mvn/version "1.5.6"}}}}. I have REPL type nREPL and Run with Deps selected. I pass oz to the Aliases text box. After clicking the Play button, the REPL opens and metasoarous/oz is not on the classpath.#2019-02-0723:09kennyIf I do clj -A:oz then (require '[oz.core]), it works.#2019-02-0723:09cflemingOk, let me try that.#2019-02-0723:10kennyFWIW, this works too clj -Aoz#2019-02-0723:16cflemingWow, that’s a lot of deps#2019-02-0723:16cflemingThat Oz pulls in.#2019-02-0723:16kennyYeah... That's actually why I wanted a separate REPL for Oz 🙂#2019-02-0723:23cflemingThat works for me.#2019-02-0723:23cfleming#2019-02-0723:24kennyOh, shoot - I had the wrong module selected. Is there a way Cursive could have told me the alias I tried using didn't exist?#2019-02-0723:24kennySimilar to the CLI#2019-02-0723:25kennyclj -A:idontexist
Error building classpath. Specified aliases are undeclared: [:idontexist]
#2019-02-0723:25cflemingSo Cursive actually filters them internally, and I’m trying to remember why.#2019-02-0723:25cflemingI think it was to do with propagation for :local/root deps.#2019-02-0723:25cflemingBut it should warn if the aliases don’t exist in the root project, yes.#2019-02-0723:02kennyYes - it has been loaded.#2019-02-0723:02kenny... through a :require. It's not the ns I am loading.#2019-02-0723:04cflemingStill, that should be enough to make it work. Do any of the previous or subsequent lines work?#2019-02-0723:04kennyEvery line in that namespace does that.#2019-02-0723:27kennyAnother item that has been a bit annoying with the Deps integration is is I have a git dep with a valid sha and then change it to an invalid sha, the auto import won't pop up and tell me that the sha is invalid.#2019-02-0723:28cflemingHmm, I wonder if that’s actually possible to determine. Doesn’t deps itself warn about that?#2019-02-0723:28kennyYes#2019-02-0723:28cflemingBut you don’t see that in Cursive?#2019-02-0723:28kennyI see it if I actually go down to the Build tab and open it.#2019-02-0723:28cflemingOh, I see.#2019-02-0723:28kennyI would've expected it to pop open with an error.#2019-02-0723:28cflemingI’ll try to fix that too.#2019-02-0723:30cfleminghttps://github.com/cursive-ide/cursive/issues/2111#2019-02-0723:31cfleminghttps://github.com/cursive-ide/cursive/issues/2112#2019-02-0801:22cfleming@kenny#2019-02-0801:23kennyNice!#2019-02-0814:10WhoNeedszZz@cfleming Are there changelogs for EAP builds? I saw one just dropped, but can't find a changelog for it#2019-02-0814:13flowthingHere, I think:
https://groups.google.com/forum/#!forum/cursive-announce#2019-02-0814:30WhoNeedszZzAh, thanks. Would be nice to link it here when they drop. And apparently the latest one hasn't been added yet.#2019-02-0821:40cflemingYes, 1.8.1-eap2 is the latest#2019-02-0908:19WhoNeedszZzHuh, then why did I only just get the prompt to download it in the past 24 hours?#2019-02-0922:30kwladykajava.lang.RuntimeException: Could not create shim
at cursive.shim.ShimProvider.getShim(Shim.kt:131)
at cursive.shim.ShimProvider.withShim(Shim.kt:98)
at cursive.repl.runner.LocalConfiguration.createDepsParameters(ReplRunConfigurations.kt:380)
at cursive.repl.runner.LocalConfiguration$getRunProfileState$2.createDeferredParameters(ReplRunConfigurations.kt:294)
at cursive.runner.DeferredCommandLineState.cacheDeferredParameters(Deferred.kt:50)
at cursive.runner.DeferredRunner$execute$1.run(Deferred.kt:86)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:727)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:582)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:87)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:403)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.postInvoke(ClojureRuntimeShimImpl.java:49)
at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.init(ClojureRuntimeShimImpl.java:31)
at org.projectodd.shimdandy.ClojureRuntimeShim.newRuntime(ClojureRuntimeShim.java:26)
at cursive.shim.ShimBootstrap.invoke(ShimBootstrap.java:26)
at cursive.shim.Shim$createShimProvider$1.invoke(Shim.kt:63)
at cursive.shim.Shim$createShimProvider$1.invoke(Shim.kt:22)
at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:138)
at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:80)
at cursive.application.ApplicationKt$sam$java_lang_Runnable$0.run(Application.kt)
... 6 more
It start to happen for all my deps.edn project about last week. How to fix it?#2019-02-0922:44kwladykaoh it looks like restart Intellij solve the issue#2019-02-1008:00Vincent CantinIs there any plan to have a REBL-like view in the IDE to which send some datafiable stuffs?#2019-02-1101:10cfleming@vincent.cantin There is a plan to investigate it, yes. There are some interesting implications, because REBL has the GUI in the actual REPL process, whereas with Cursive the GUI is in an external process (IntelliJ itself). I still don’t know what the full implications of that are, so no promises.#2019-02-1103:22cfleming@kenny I’m testing the git lib missing SHA fix. However I can’t reproduce what you’re seeing - for me, if the SHA is invalid, then when I refresh the project the Build toolwindow pops up with a pretty clear message. Is there some other circumstance when that’s less visible?#2019-02-1115:59kennyYes. When using auto-import, it does not pop open the Build window.#2019-02-1300:56cfleming@kenny I’ve investigated this, and I can’t see a way to fix it. Errors are deliberately suppressed for auto-import refreshes, presumably because errors are common while you’re editing build files. I can’t see a way to modify that behaviour.#2019-02-1300:56cflemingThe best workaround I can suggest is to manually refresh after changing SHAs, which does show the error.#2019-02-1300:58cflemingOr just manually check the Build tab, I guess.#2019-02-1300:59kennyOh right, you wouldn't want to message the user while they are editing it. I hit this case all the time though -- I accidentally copy a SHA from the wrong repo or forgot to push a SHA -- and the results are confusing. Perhaps a better solution would be if you try and start a REPL after the refresh and the build failed, alert the user.#2019-02-1301:06cflemingDoesn’t that already happen when the build fails?#2019-02-1301:06cflemingI guess for most people, starting the REPL doesn’t actually build anything…#2019-02-1301:06kennyNot sure. Lemme check.#2019-02-1301:08kennyNo it does not tell me. This is what I do:
1. Start with a valid git SHA
2. Change the SHA to an invalid one
3. Hit save & wait for the auto import to finish
4. Hit REPL play button
5. No error#2019-02-1301:08cflemingRight. I’m not sure at which point there Cursive could realistically detect and show an error.#2019-02-1301:09kennyEven printing a message in the actual REPL that the classpath is "stale" or does not match the classpath in deps.edn#2019-02-1301:10cflemingBut hold on - when you start the REPL in step 4, do you still get the previous classpath?#2019-02-1301:10kennyYes#2019-02-1301:11cflemingOk, so that is a bug I can definitely fix.#2019-02-1301:11kennyWhat should happen?#2019-02-1301:11cflemingOne sec…#2019-02-1301:11cflemingOnce you’ve updated deps.edn, if you run a REPL from a Run Config that uses that deps.edn it should definitely use the new one.#2019-02-1301:12kennyAnd what should happen if the deps.edn is not valid?#2019-02-1301:13cflemingThat will depend on what deps does, but I think it should show an error.#2019-02-1301:13cflemingOne sec, let me try this with my test project.#2019-02-1301:37cfleming@kenny I can’t reproduce that. Here’s what I’m doing:
1. Create a deps project with a git dep with a valid SHA. Then sync it etc.
2. Running a REPL with this works fine.
3. Modify SHA to be invalid, press save, check in Build toolwindow that message appears.
4. Run REPL again, and I get an error Error creating Run Parameters, and a message in the Run toolwindow about the SHA.#2019-02-1301:37cflemingI just fixed a bug where the message about the SHA in step 4 occasionally wouldn’t be shown, but under normal circumstances it would.#2019-02-1301:39cfleming#2019-02-1301:39kennyI've never seen that message.#2019-02-1301:41cflemingLet me try this with the current published version, in case the version I’m running has something fixed that’s affecting this.#2019-02-1103:27artrmrnoHi, I'm trying to create a deps.edn project and got the error 'Cannot execute: Clojure command not configured'. I installed Clojure using brew on mac and the clojure command is in my PATH. Is there another PATH I have to set up in IntelliJ?#2019-02-1104:59artrmrnoNevermind, I went to the 'Clojure Deps' settings, made a change to use 'toolds.deps' and then back to 'CLI' tools and I didn't get the error anymore.#2019-02-1104:59artrmrnoNevermind, I went to the 'Clojure Deps' settings, made a change to use 'toolds.deps' and then back to 'CLI' tools and I didn't get the error anymore.#2019-02-1119:00Yehonathan SharvitHi there#2019-02-1119:49buttergunsHi - I sent something to the mailing list, but I wonder if this would be a better place for it: is it possible the Organize Imports function will ever work. I would love Cursive to clean up my :requires and :imports#2019-02-1120:19vemvI'm gonna extract the clean-ns op from https://github.com/clojure-emacs/refactor-nrepl for easy, editor-agnostic usage pretty soon.
Keep an eye on #announcements ... maybe in a couple weeks?#2019-02-1120:28buttergunsI always wondered why "refactors" were tied to a specific editor, rather than being a framework that any editor could plug into#2019-02-1120:30vemvluckily refactor-nrepl is agnostic. but IIRC it still needs to talk over the nrepl protocol. I want to make it easier - just one fn call away from your repl#2019-02-1121:27rodsenraHi, I wonder if anybody had any trouble with Cursive v1.8.1-eap2-2018.3, tools.deps and Clojure 1.10.0.?#2019-02-1121:27Alex Miller (Clojure team)perhaps you could explain what trouble you’re seeing?#2019-02-1121:28rodsenraSure. Let’me grab the details here#2019-02-1121:33rodsenraclj -A:main
runs just fine from the shell. (using clojure 1.9.0 in deps)
However from Cursive, I do get:
Exception in thread “main” java.io.FileNotFoundException: -m red-robin.main (No such file or directory) when using
from within Cursive#2019-02-1121:35rodsenraI do have clojure 1.10 installed via brew#2019-02-1122:06Alex Miller (Clojure team)does your deps.edn :paths match the root of your source?#2019-02-1122:08rodsenraThis is my deps.edn
:main
{:extra-paths ["src"]
:main-opts ["-m red-robin.main"]}
#2019-02-1122:09rodsenraSame structure on Cursive#2019-02-1122:10rodsenraCursive debug config#2019-02-1122:11rodsenraI wonder if this is related to have clojure 1.9.0 in tools.deps, but also having clojure 1.10 installed by brew :thinking_face:
I even tried to downgrade clojure to 1.9.0 but could not using brew.#2019-02-1122:11Alex Miller (Clojure team)that shouldn’t matter at all#2019-02-1122:12Alex Miller (Clojure team)any brew installation should work with any Clojure version#2019-02-1122:13rodsenraUsing brew, I can only install 1.10. Could not figure out how to install 1.9 after 1.10 was released.#2019-02-1122:14rodsenraMy project currently does not run on 1.10
Call to clojure.core/ns did not conform to spec.
But I will investigate that later.#2019-02-1122:15rodsenraAfter upgrading to 1.10, Cursive stopped working, that is why I suspected a relation. But I think Cursive also upgraded, so now I am not sure what was the cause.#2019-02-1122:16Alex Miller (Clojure team)you can use something like brew switch clojure 1.9.0.397 to switch to a different (older or newer) version#2019-02-1122:17rodsenraI have tried that, but got
Error: clojure does not have a version "1.9.0.397" in the Cellar.
#2019-02-1122:18rodsenraThe only 1.9.0 that I have was installed by Cursive through maven#2019-02-1122:18Alex Miller (Clojure team)well, it has to be a version you’ve installed in the past - brew info clojure#2019-02-1122:18Alex Miller (Clojure team)I don’t think Cursive does anything with brew. you may be confusing two different things here#2019-02-1122:19Alex Miller (Clojure team)Maven is used to download versions of the clojure jar (the language itself) - those versions are usually like 1.9.0 or 1.10.0#2019-02-1122:19rodsenraI know. What I am saying is that on brew I can only get clojure 1.10
$ brew info clojure
clojure: stable 1.10.0.411
The Clojure Programming Language
/usr/local/Cellar/clojure/1.10.0.411 (9 files, 21.1MB) *
Built from source on 2019-02-11 at 10:58:02
From:
==> Dependencies
Required: rlwrap ✔
==> Requirements
Required: java >= 1.8 ✔
==> Analytics
install: 2,988 (30 days), 12,022 (90 days), 41,661 (365 days)
install_on_request: 2,949 (30 days), 11,821 (90 days), 40,716 (365 days)
build_error: 0 (30 days)
#2019-02-1122:19Alex Miller (Clojure team)brew is used to install a version of the clojure and clj tools which have versions like 1.9.0.397 or 1.10.0.411#2019-02-1122:19rodsenraBut in my deps.edn I have org.clojure/clojure {:mvn/version “1.9.0”}#2019-02-1122:20Alex Miller (Clojure team)the tools are the things that let you run clojure or clj at the terminal#2019-02-1122:20rodsenraGot it. I saw the source for the bash scripts.#2019-02-1122:21Alex Miller (Clojure team)many tools (clj, lein, boot, Cursive, etc) may cause the Clojure jar to get downloaded and cached in the Maven repository#2019-02-1122:21Alex Miller (Clojure team)that error you posted before (Call to clojure.core/ns did not conform to spec.) will prevent a namespace from loading, so is likely to be a problem for you#2019-02-1122:22rodsenraThat only happens when I change deps.edn from 1.9.0 to 1.10#2019-02-1122:23rodsenraI will try to go deeper into what Cursive is trying to run, to check out why 1.9.0 is failing.#2019-02-1122:25rodsenraThanks @alexmiller 🙇#2019-02-1122:37rodsenraInteresting. From the shell, both versions below do work
clj -m red-robin.main
clj -A:main
From Intellij, it breaks on:
Clojure 1.9.0
nREPL server started on port 64956 on host 127.0.0.1
Exception in thread "main" java.io.FileNotFoundException: -m red-robin.main (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
...
at clojure.main.main(main.java:37)
Because it is passing “-m red-robin.main”from deps.edn straight to:
public static void main(String[] args) {
REQUIRE.invoke(CLOJURE_MAIN);
MAIN.applyTo(RT.seq(args));
}
#2019-04-2403:04wilkerlucioit got back working after restarting IntelliJ entirely#2019-04-2403:06cfleming@wilkerlucio Which IntelliJ version are you on? Did you just upgrade?#2019-04-2403:06wilkerlucioIntelliJ IDEA 2019.1 (Ultimate Edition)
Build #IU-191.6183.87, built on March 27, 2019
JRE: 1.8.0_202-release-1483-b39 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.1
#2019-04-2403:06wilkerlucioits been some time since I did the update#2019-04-2403:14currentoor@wilkerlucio that happened to too, invalidate cache and restart fixed it#2019-04-2403:14currentoorin the File menu#2019-04-2403:15wilkerluciothanks, in my case just a regular restart (without invalidating caches) did the trick#2019-04-2413:23wilkerlucio@cfleming the same issue just happened again, I had just that project open (lets call it A), then I opened project B, just after that project A resolution got broken again#2019-04-2413:25wilkerlucioand at work I had reports from other coworkers that this is happening with some frequency, not totally sure but seems to started to happen more often after upgrading to IntelliJ 2019#2019-04-2414:36borisDoes anyone know what action is run when a user hits the escape key in the repl? It shifts focus away from the repl editor and back to the last file edited. I’m asking because I’d like to rebind this behavior so that cmd+\ toggles between focusing and hiding the repl editor and so far it only does the former#2019-04-2415:01manutter51Looks like it does the Editor -> Escape action, as far as I can see.#2019-04-2422:33cfleming@wilkerlucio Someone else mentioned that too, exactly the same symptoms. I think it must be an IntelliJ bug.#2019-04-2422:34cflemingDoes it always happen with a particular project, or does it seem to be random?#2019-04-2514:02jffryI've had the same issue since upgrading to IDEA 2019.1.1 and Cursive 1.8.1. I used the cursive 1.8.1-eap in IDEA 2018.3 without issue.
It seems to be nondeterministic - repeatedly loading the same project sometimes fails and sometimes succeeds.
I dumped some logs at https://gist.github.com/jffry/228c51978b1f351866a3be98bad5db6d and am happy to help troubleshoot further#2019-04-2514:05jffryI should add that I've experienced this with a variety of projects, some leiningen and some deps, and I have experienced it with both freshly-checked-out repos and projects that have been on my machine for years#2019-04-2422:37cfleming@boris834 Unfortunately ESC jumping back to the editor from toolwindows is hard-coded in IntelliJ. There are various IdeaVim issues about this, and various hacks in recent IntelliJ versions, but it’s not very customisable.#2019-04-2620:41mandersonI’ve been experiencing this issue as well. It started today when I upgraded to Cursive v1.8.2-eap1-2019.1 (I’m running IntelliJ 2019.1.1). I was able to resolve one project by fiddling with the JDK settings, but I have another I was not able to get working. (tried “invalidate and restart”) I see similar stacktraces as above:
2019-04-26 16:36:37,912 [ 15014] INFO - il.indexing.FileBasedIndexImpl - Rebuild requested for index ClojureClasses
java.lang.Throwable
at com.intellij.util.indexing.FileBasedIndex.requestRebuild(FileBasedIndex.java:70)
at cursive.intentions.resolve$rebuild_all_indexes_BANG_.invoke(resolve.clj:142)
at clojure.lang.Var.invoke(Var.java:383)
at cursive.api.DelayedFn.invoke(DelayedFn.java:36)
at cursive.settings.ClojureProjectResolveSettings$loadState$1.run(ClojureResolveSettings.kt:95)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:311)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
#2019-04-2505:35ikitommiSeen also that non-resolving thing, have been invalidating, restarting and deleting the idea-related files & dirs from the project. Will send logs when it happens next. Annoyingly random.#2019-04-2513:31claudiuhi 🙂 just updated to the latest cursive 1.8.2-eap1 and intellij 2019.1.2 Preivew. I updated clojuredocs from languages and frameworks, but just the usual stuff when I type something like juxt or view docs on it. Is there anything else I have to do ?#2019-04-2616:29timgilbertTry hitting F1?#2019-04-2514:57gklijsI just updated the plugin and got an error. It seems not able to get the clojuredocs.#2019-04-2514:58gklijsjava.io.IOException: Cannot download 'https://clojuredocs.org/clojuredocs-export.json': http://clojuredocs.org
at com.intellij.util.io.HttpRequests$RequestImpl.saveToFile(HttpRequests.java:473)
at cursive.documentation.ClojureDocsStartupActivity$notify$listener$1$1$file$1.invoke(ClojureDocs.kt:53)
at cursive.documentation.ClojureDocsStartupActivity$notify$listener$1$1$file$1.process(ClojureDocs.kt:23)
at com.intellij.util.io.HttpRequests.doProcess(HttpRequests.java:528)
at com.intellij.util.io.HttpRequests.process(HttpRequests.java:504)
at com.intellij.util.io.HttpRequests.access$100(HttpRequests.java:59)
at com.intellij.util.io.HttpRequests$RequestBuilderImpl.connect(HttpRequests.java:357)
at cursive.documentation.ClojureDocsStartupActivity$notify$listener$1$1.invoke(ClojureDocs.kt:51)
at cursive.documentation.ClojureDocsStartupActivity$notify$listener$1$1.invoke(ClojureDocs.kt:23)
at cursive.tasks.TasksKt$inBackground$1.run(Tasks.kt:18)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:731)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:403)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:311)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.UnknownHostException: http://clojuredocs.org
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:666)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1199)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1050)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1564)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:347)
at com.intellij.util.io.HttpRequests.openConnection(HttpRequests.java:615)
at com.intellij.util.io.HttpRequests.access$300(HttpRequests.java:59)
at com.intellij.util.io.HttpRequests$RequestImpl.getConnection(HttpRequests.java:383)
at com.intellij.util.io.HttpRequests$RequestImpl.getInputStream(HttpRequests.java:392)
#2019-04-2514:58gklijs at com.intellij.util.io.HttpRequests$RequestImpl.saveToFile(HttpRequests.java:469)
... 22 more#2019-04-2515:04gklijsGot them on a second try#2019-04-2518:34shaun-mahood@claudiu If you figure it out let me know - mine isn't doing anything either.#2019-04-2616:29timgilbertTry hitting F1?#2019-04-2616:43manutter51I just tried that, but it just takes me to the online help for the IntelliJ Editor, it doesn’t bring up the downloaded clojuredocs at all.#2019-04-2617:45kennyHow does Cursive set the Clojure version for a REPL?#2019-04-2617:49joshkhwhat might i be doing wrong here? i'm firing up a repl with src and test dirs in my dep.edn's :paths key. one of my test namespaces has a dependency on one of my src namespaces, but cursive says it can't find the src namespace:
; src/cljc/schema/spec.cljc
(ns schema.spec
(:require [clojure.spec-alpha2 :as s]))
; test/schema/format.clj
(ns schema.format
(:require [clojure.test :as t :refer [deftest is testing]]
[schema.spec :as ss]
[clojure.spec-alpha2 :as s]))
; attempting to load schema.format:
Loading test/schema/format.clj...
Syntax error (FileNotFoundException) compiling at (format.clj:1:1).
Could not locate schema/spec__init.class, schema/spec.clj or schema/spec.cljc on classpath.
thanks!#2019-04-2618:31Alex Miller (Clojure team)based on what you have, seems like src/cljc should be in paths#2019-04-2709:40joshkhah, of course. thanks alex.#2019-04-2618:31Alex Miller (Clojure team)basically whatever directory is containing the root of the namespaces#2019-04-2618:32Alex Miller (Clojure team)to use spec-alpha2, you will also need a git dep on clojure.spec-alpha2 repo#2019-04-2622:35hlshipIs there a cheatsheet somewhere about which version of Cursive are compatible with which versions of IntelliJ. I'm thinking of upgrading to 2019.1.1 and don't know if that will break Cursive.#2019-04-2623:53cfleming@hlship You’re fine to upgrade, basically any given version of Cursive supports the previous two years’ versions of IntelliJ, so currently it’s back to 2017.1. There is a problem with the indexing which I suspect is a 2019.1 bug in IntelliJ (discussed above) and an annoying issue with brace matching, so if you don’t have a compelling reason to upgrade you may wish to wait.#2019-04-2623:54cfleming@joshkh What Alex said, seems like src/cljc should be in your path, not src.#2019-04-2623:54cfleming@kenny It doesn’t really, it’s just taken from the classpath, so whichever version of Clojure your module has as a dependency.#2019-04-2623:55cfleming@manutter51 It’s just shown in the standard doc popup, so whatever you have View | Quick Documentation bound to.#2019-04-2700:39okworiHey guys, Do this functionality work? or rather how can I use it appropriately to say run ClojureScript command on the REPL#2019-04-2701:52cflemingTo everyone experiencing the indexing issue with multiple projects (@wilkerlucio @manderson @ikitommi @jffry @polymeris @p-himik and others), I’ve filed this: https://youtrack.jetbrains.com/issue/IDEA-211736#2019-05-0117:47polymerisSeeing this issue again (this time running 2019.1.2 Preview)
It doesn't seem to have anything to do with having multiple projects open#2019-05-0117:47polymeris(IDEA projects, I mean, I have multiple lein projects in that single IDEA project)#2019-05-0200:04cfleming@polymeris Could you attach your log file to that YouTrack issue, please?#2019-04-2701:53cflemingIt’s unfortunately fairly vague, but hopefully they can investigate there. If anyone downgrades from 2019.1 and that fixes the problem that would be useful to know too.#2019-04-2701:55cfleming@simon That doesn’t actually change the type of the REPL, i.e. what the REPL server is doing, it’s just a way of telling Cursive what sort of REPL is actually running. Usually with CLJS you’ll start a Clojure REPL and then start the CLJS REPL inside it, if Cursive doesn’t automatically detect that you’ve switched to a CLJS REPL you can use that dropdown to tell it.#2019-04-2714:22okworiInside of the same REPL?! I would love to know how to do that. Usually I connect the CLJS REPL via remote, i.e. two instances of REPL, one local for CLJ and the other remote for CLJS.#2019-04-2703:19p-himikIs there any way to inspect a complicated data structure in REPL? E.g. an XML zipper.#2019-04-2704:46cfleming@p-himik Not out of the box now, no. There are things like data.inspect which pop up a swing browser, I have a plan to have something similar which opens a data structure in the IntelliJ UI, but there’s nothing there yet.#2019-04-2704:48p-himikI see. Thanks!#2019-04-2710:52Adrian SmithI have some source code in src/<my project name> I can right click it and press -> new, and it lists a lot of different files I could create in that directory but I can't create a new sub directory?#2019-04-2710:53Adrian Smithwhat's the recommended way to create new directories in cursive?#2019-04-2710:59Adrian SmithSeems like new -> package creates a new dir#2019-04-2711:05cfleming@sfyire Yes, that’s a Java hangover#2019-04-2711:06Adrian Smithah thank you for the context#2019-04-2711:09cflemingYou can also create my.full.namespace from your src folder, and Cursive will create my/full/namespace for you.#2019-04-2711:10cfleming@sfyire ^^#2019-04-2907:37souenzzoAnyone else with
java.lang.NoClassDefFoundError: org/jetbrains/idea/maven/dom/MavenVersionComparable
at cursive.deps.DepsManager$Companion.configFiles(DepsSupport.kt:253)
When trying to open a deps project?#2019-04-2908:32p-himikNot on IDEA 2019.1.1 + Cursive v1.8.2-eap1-2019.1.#2019-04-2908:33souenzzoI'm on this version too#2019-04-2908:34p-himikIDEA as well?#2019-04-2921:30cfleming@U2J4FRT2T Do you have the Maven plugin installed and enabled?#2019-04-2921:30cflemingIt looks like I might have some code relying on it which doesn’t test correctly whether it’s there or not.#2019-04-2911:07vinaiI just upgraded to Cursive v1.8.1-2019.1 and IntelliJ 2019.1.1 CE and now I get
Error loading nrepl.server: Could not locate nrepl/server__init.class, nrepl/server.clj or nrepl/server.cljc on classpath
...
No nREPL ack received
In my project.clj I've got [nrepl "0.3.1"] and I tried with [org.clojure/tools.nrepl "0.2.13"] before that.
lein repl starts the nrepl server without an issue. Any idea why is wrong?#2019-04-2911:12p-himikI think it's a common issue with nrepl - some of the API has been changed in an incompatible way. Try looking it up on the Internet, there are different fixes depending on your particular situation.#2019-04-2911:12vinaiThanks, doing that#2019-04-2911:13vinaiIt was working with the previous version of cursive and intellij (whatever those where...)#2019-04-2911:15p-himikFor what it's worth, I have org.clojure/tools.nrepl {:mvn/version "0.2.13"} in my deps.edn. I don't use Leiningen at all.#2019-04-2911:16vinaiThis is an old project that is lein based. The newer ones use deps.edn, too#2019-04-2911:17p-himikIf you can't find anything related, I'd try to recreate the error with the smallest example possible. That should give at least some idea of what's wrong.#2019-04-2911:18vinaiGood idea, thanks#2019-04-2911:19vinaiTrying the new namespace nrepl 0.6.0 now#2019-04-2911:27vinaiAfter updating nrepl to 0.6.0, removing the jackson-core exclusion from buddy-auth, adding an explicit dependency on cheshire5.8.1 and updating cider/piggieback to 0.4.0 I've got a repl again 🙂#2019-04-2911:28vinaiAll these changes where triggered by changing exceptions during startup, i.e. change one thing, get a different exception, fix that, repeat.#2019-04-2911:30p-himikYep, sounds about right. 🙂#2019-04-2911:42vinaiOh boy, another interesting new behavior. I'll start a new thread for that though.#2019-04-2911:45vinaiWhen starting figwheel in my cljs repl IntelliJ starts asking "Enter string for standard input" in a popup. Whatever I enter seems to be sent to the cljs repl, evaluated, and printed. The repl output window just echos the value and shows the prompt app:cljs.user=> again.
So somehow the read doesn't happen in Cursives repl input window but through IntelliJs prompt.
I'm starting figwheel with
(use 'figwheel-sidecar.repl-api)
(start-figwheel!)
(cljs-repl))
Has someone encountered this, too?#2019-04-2911:45vinai#2019-04-2912:02vinaiThis seems to be the same issue in a different setting: https://github.com/cursive-ide/cursive/issues/835#issuecomment-353577243#2019-04-2912:12vinaiDang, seems like I have to work without hot reloading today.#2019-04-2912:14vinaiOh wait, after :cljs/quit autobuilding still is running in figwheel. So I'm only missing the cljs repl.#2019-04-2912:15vinaiI can open one with lein in a terminal though - that's good enough#2019-04-2912:17vinaiWould be great to get a real solution, but until then I can get stuff done.#2019-04-2912:36okworihttps://clojurians.slack.com/archives/C0744GXCJ/p1556374926032300?thread_ts=1556330135.025400&cid=C0744GXCJ#2019-04-2912:50vinaiThat's been my setup so far. But after today's upgrade things started breaking @U2TLBUVRS.#2019-04-3021:43cfleming@U3WJG25EV I’ve replied over on the GH issue.#2019-04-3021:44vinaiThanks @U0567Q30W !#2019-04-2913:33ChrisDoes anyone know how to navigate to the REPL Output screen without the mouse? I can get to the input window with the Switcher, but I can't get up to the Output screen to scroll history without clicking in with the mouse?#2019-04-2913:38p-himikThere's "Jump to REPL output pane" in the Keyboard settings.#2019-04-2913:43ChrisOMG I never saw that before and when I did search for action with REPL I didn't look far enough down! Thanks so much!#2019-04-2920:29arnohaJust installed Cursive, REPL is working but the text editor window isn’t eval’ing the code unless I explicitly Load file in REPL.
Went through the online docs and don’t think I’ve missed any of the setup, any ideas?#2019-04-2920:36manutter51I think I had to go in to Preferences -> Keymap -> Plug-ins -> Cursive and set up my preferred key bindings for “Load file in REPL,” “Send form before caret to REPL,” and “Send top form to REPL”.#2019-04-3011:15joelsanchez@cfleming would it be possible to make "toggle auto scroll" automatic? (when I scroll up, disable it, and when I scroll to the bottom, enable it). this is how the Chrome Devtools console works, and other applications too#2019-04-3011:15joelsanchezor is it an Intellij IDEA shortcoming?#2019-04-3018:32p-himikIt's Cursive that adds all the libraries to the modules that I add via the standard IDEA interface in "Project Structure" dialog, right?
The issue is that upon reindexing (or maybe not - I closed IDEA, changed the branch in terminal, made some changes, switched the branch back, opened IDEA again), the order of <orderEntry> tags in most of the .idea/modules/*.iml files was changed for no reason.#2019-04-3021:45cfleming@joelsanchez Which window would you like this in? The main editors? Sorry, I’m not familiar with the auto scroll.#2019-04-3021:46joelsanchezthe REPL#2019-04-3021:47cflemingOh, I see. So when you scroll up, you’d like it to stay where you left it, and then when you scroll back down to the bottom you want auto scroll to enable again?#2019-04-3021:47joelsanchezmany apps log to stdout, and sometimes I want to briefly look at something in the logs but then keep on working with the REPL and of course I need autoscroll on#2019-04-3021:47joelsanchezyep#2019-04-3021:48cflemingOk, that makes sense.#2019-04-3021:48cflemingIn fact, that’s https://github.com/cursive-ide/cursive/issues/1000#2019-04-3021:49joelsanchezyes, yes it is :)#2019-04-3021:49joelsanchezDaniel is always one step ahead of us mere mortals#2019-04-3021:49cflemingI believe he’s filed more Cursive issues than I have 🙂#2019-04-3021:51cflemingActually no I still have him beaten - 259 to 209.#2019-04-3022:46caleb.macdonaldblackIn the cljs repl I keep getting the intellij "<fn> can be required" recommendation for every function I use that isn't a core function even if it's required. Is there any way to fix that?#2019-04-3023:54cfleming@p-himik It is, but I can’t control that order, sorry - that’s IntelliJ doing that.#2019-05-0100:00cfleming@caleb.macdonaldblack I don’t think there is, sorry - is that in the actual REPL editor?#2019-05-0100:00cflemingI’ll see if I can reproduce that and fix it.#2019-05-0100:02caleb.macdonaldblack@cfleming https://i.gyazo.com/811e53a2adf6138688eca3c751e95eb1.png#2019-05-0100:03caleb.macdonaldblackI'm not sure exactly what the REPL editor is but I think that is it#2019-05-0100:03cflemingThanks, I’ll try to reproduce that and fix it.#2019-05-0100:03cflemingYes, I mean you’re working in the little REPL input pane editor.#2019-05-0100:04cflemingi.e. not sending forms from a normal editor.#2019-05-0100:04caleb.macdonaldblackYea pretty much. It's probably a bad habit I should break out of though#2019-05-0100:05cflemingCertainly it would fix this problem 🙂#2019-05-0100:06cflemingOr at least work around it.#2019-05-0100:06caleb.macdonaldblackYep. I probably would worry too much about looking into then unless you want to. I'll try to send to the repl. It's better to do it that way anyway#2019-05-0107:03p-himikIs it possible to make Cursive resolve dependencies in the editor while taking some specific aliases into account?#2019-05-0111:13cfleming@p-himik I don’t understand, can you explain?#2019-05-0111:14p-himikI have deps.edn with multiple aliases many of which specify :extra-deps. And it seems that they're not taken into account at all.#2019-05-0111:16cflemingYes, you can do that by selecting those aliases in the Clojure Deps toolwindow under Aliases. Select the ones you want and then refresh your project.#2019-05-0111:17cflemingThere was a problem reported today if you have :extra-deps with :local/root dependencies in it - I’m hoping to look at that tomorrow.#2019-05-0111:21p-himikAhh, I see. Thanks! I have a lot of :local/root. 🙂 Here's a decent example of a complicated deps.edn if you need one: https://github.com/juxt/edge/tree/master/examples/main#2019-05-0111:22cflemingYeah, the issue was this one: https://github.com/cursive-ide/cursive/issues/2164, which is based on a project using Edge.#2019-05-0111:22cflemingIt’s odd because I was sure I’d tested the edge examples, it’s possible something has broken.#2019-05-0203:20cflemingOk, this is fixed for the next build.#2019-05-0116:01Lukasz HallAnyone else get an Error executing Leiningen task: '1.8' is bad configured when starting a local nRepl? (I've switched the project dep from clj 1.10 to 1.8 and reimported the project and still see the error)#2019-05-0200:01cfleming@hall That error is referring to your JDK configured for the project - could you check that that is properly configured?#2019-05-0214:19Lukasz Hallyup... that was it. Can't believe I didn't check that.... looks like some pathing issues on my machine. Thanks!#2019-05-0213:55p-himikSomething strange is happening.
I've just restructured my project a bit and now Cursive says "Manifest type not detected when finding deps" during deps.edn project syncing.
I tried running clj -Stree - same error. Updated the clj CLI tools so that now they use tools.deps 0.6.496 which fixes TDEPS-74, now clj -Stree running smoothly.
But Cursive still gives the same error even though in setting it says that it uses the latest tools. I also tried selecting "Use tools.deps directly" but "Refresh" never completes, it just spins forever.#2019-05-0214:08p-himikNot sure how it all works. But when I removed everything within ~/.m2/repository/org/clojure/tools.deps.alpha, nothing has changed but also no new files appeared there. As if both clj and Cursive use a bundled version of tools.deps.#2019-05-0222:21cflemingclj uses a bundled version of tools.deps, yes. In Cursive, if you select to use the CLI tools then that version will be used, or if you select to use tools.deps directly, it’ll be downloaded using Maven and should appear in your local repo.#2019-05-0307:02p-himikBut clj works and Cursive doesn't, although it says it uses the correct version of clj.#2019-05-0307:05p-himikOf course, maybe clj started working after upgrade only when I start it with -Stree, and maybe it still doesn't work with regards to something else that Cursive uses. Is there any way I could check it?#2019-05-0307:07p-himikAlso the point about not being able to specify custom tools.deps is still valid - the spinner just spins forever.#2019-05-0307:48p-himikWithout me doing anything, the error switched to "Sync finish event has not been received". I removed .idea from the project, imported the project again - all is fine! However, the error about the manifest time is back when I select one particular alias. And the same alias works perfectly with clj, so there is still some sort of a problem.#2019-05-0322:01cfleming@U2FRKM4TW That’s very strange. Is this a project I could look at, or is it internal?#2019-05-0322:16cflemingWhat does the problematic alias have in its definition? Perhaps I can reproduce something similar.#2019-05-0407:06p-himikAlas, can't share anything.
And lo and behold - today all is fine, even with that alias! Again, without me changing anything. Maybe an additional restart of IDEA has somehow helped. I'm clueless.#2019-05-0414:45mhuebertI am also having the problem of the infinite spinner#2019-05-0414:47mhuebertpreviously, I was using “Use tools.deps directly” but I had to switch to “Use CLI tools” because of the spinner / not being able to select a recent version#2019-05-0414:48mhuebertnow I have a problem with clj(s) forms not being defined even though I have Clojure/ClojureScript on the classpath#2019-05-0500:15cfleming@U050RLRRQ @U2FRKM4TW Do either of you have a proxy enabled? That’s the only thing I can think of that has changed recently (https://github.com/cursive-ide/cursive/issues/2150, oh and also https://github.com/cursive-ide/cursive/issues/2149 but that shouldn’t affect if you don’t specify a repo).#2019-05-0504:42cflemingUgh, actually, this is just a stupid UI bug introduced as part of those changes. I’ll fix for the next build.#2019-05-0313:09Jacob HaagWith intelij, for certain languages you can use an "intention" to generate the outline of a test for a desired function. Does this capability exist for Clojure and if not is it something that's been considered to add to Cursive?
https://www.jetbrains.com/help/idea/create-tests.html#2019-05-0313:14manutter51If you right-click on a function and select Go To -> Test, it will give you the option of creating the test if it does not already exist.#2019-05-0313:27Jacob HaagAh neat, it's pretty minimal but is nice none the less#2019-05-0313:50mhuebertI just updated to the latest cursive and notice that bracket highlighting has changed, so that “outer brackets” are preferred to “inner brackets”. Was this an intentional change?#2019-05-0313:51mhueberti believe the previous behavour was aligned with what “Extend selection” would select#2019-05-0315:27conanthis is a good way of describing it#2019-05-0313:56manutter51Yes, that happened with a recent version and it’s a known issue. I think the underlying issue is something that changed in IntelliJ, and we’re waiting for JetBrains to fix it?#2019-05-0315:22mhuebertok, thanks#2019-05-0315:49Jacob HaagHow would I go about finding unused re-frame subscriptions w/ intelij and cursive? I tried using Analyze | Inspect Code but it doesn't pick up subscriptions lie
(re-frame/reg-sub
::foo
____)
#2019-05-0318:10p-himikI don't think you can do anything apart from the full-text search or usages search (which can be slower than just full-text search).#2019-05-0322:09cflemingYes, there isn’t a very good solution for this right now, unfortunately. The global “Unused declaration” inspection doesn’t work for Clojure code, and I haven’t investigated why yet.#2019-05-0316:49kennyCursive doesn't seem to always persist the REPL history. I'm on Ubuntu. When I restart my computer, only some very old REPL history is shown. If I close IntelliJ before shutting down, however, it will persist correctly.#2019-05-0322:10cflemingUnfortunately I don’t think there’s much I can do about this, it’s just IntelliJ’s persistence mechanism. Do you find that other settings are also lost when shutting down like this?#2019-05-0322:57kennyI don't change other settings often enough. I'd expect settings to not be affected by this because in order to change those, I need to explicitly hit the Save button. The REPL history seems like it'd be saved in the same way regular files are saved. I do not have the problem of lost data when changing files.#2019-05-0322:05cfleming@mhuebert Yes, this is an unfortunate IntelliJ regression. The original issue was here: https://youtrack.jetbrains.com/issue/IDEA-210104, when that wasn’t fixed completely, https://youtrack.jetbrains.com/issue/IDEA-211720 was the follow-up.#2019-05-0322:21mhuebert@cfleming thanks for the links, happy to know it is being worked on by IntelliJ. I find the current behaviour confusing.#2019-05-0322:43cflemingYes, it’s definitely super confusing. I suspect it’s not as bad for non-Lisp languages which don’t have tons of close parens stacked up, but for Clojure it’s very hard to figure out what’s going on.#2019-05-0416:42Kari MarttilaI have a "dev-src" alias in my deps.edn in which I keep development time sources and dependencies:
:dev-src {:extra-paths ["dev-src"]
:extra-deps {org.clojure/tools.namespace {:mvn/version "0.2.11"}}}
If I open a file in that "dev-src" IntelliJ IDEA complains that the file "is not under a source root".
I can use clojure namespaces defined in that "dev-src", everything works just fine in REPL but there is just that "is not under a source root" IntelliJ IDEA warning in the beginning of the editor window. I can live with that but I was wondering if there is an easy way to disable it?#2019-05-0416:51Kari MarttilaThe warning disappears if I add the "dev-src" to paths:
:paths ["src", "dev-src"]
, of course. But I understood that with deps.edn paths defines the "production code" and you can define other "extra-paths" using aliases, as creating an alias for development time code (used with REPL) as I did.#2019-05-0422:09cjmurphyYou can right click a directory in the project pane, then Mark directory as Sources Root.#2019-05-0423:44cfleming@U76D9RZRR In the Clojure Deps toolwindow, open the Aliases tree, select the dev-src alias there and then refresh your project.#2019-05-0506:59Kari MarttilaThanks @U0567Q30W! That solved my problem. I'm also trying to learn how to use Cursive effectively with deps.edn.#2019-05-0417:49polymerisI am experimenting with shadow-cljs, and to resolve cljs deps, I am using shadow-cljs pom, then having intellij import that pom.
Not sure how to get cursive to resolve the npm deps, though.
I.e, things like (:require ["foo" :as bar]). Is it possible?#2019-05-0507:50p-himikI don't think the pom is required. At least, I don't use it - all my dependencies are in deps.edn, and Cursive knows how to handle it, as well as Shadow CLJS.#2019-05-0507:51p-himikBy "resolve NPM deps" you mean correct highlighting and declaration following when requiring NPM deps from CLJS files? If so, it's not yet implemented AFAIK.#2019-05-0513:40polymerisI am not using deps.edn (only shadow-cljs.edn for clj/s deps and package.json for npm deps)#2019-05-0513:40polymerisYeah, I meant correctly highlighting the symbols imported from npm deps#2019-05-0513:42polymerisI notice Cursive does highlight some js stuff it seems to magically know about#2019-05-0513:42polymerisE.g. it knows about js/console#2019-05-0513:44polymerisAnd it knows about e.g. goog.async (but I guess those are defined in the maven deps somewhere, not in the npm deps)#2019-05-0513:50p-himikAFAIK js/console comes from the built-in externs and goog.async is probably a dependency of CLJS itself.
Just in case - if you don't want to regenerate the pom each time you change the dependencies, you can just switch to deps.edn + shadow-cljs.edn: https://shadow-cljs.github.io/docs/UsersGuide.html#deps-edn#2019-05-0514:01polymeris:thank-you:#2019-05-0522:31cflemingThis is correct, Cursive knows about some built-ins (using the ones from Tern: http://ternjs.net/) and also indexes JS code attached via Maven (e.g. Closure itself).#2019-05-0522:32cflemingIt doesn’t yet index JS from node_modules or understand the node require syntax, but I’m actually re-vamping the JS parsing right now and hopefully that will make it in as part of this change.#2019-05-0522:32cflemingSince a lot more projects are using it these days.#2019-05-0522:33cflemingI’m currently switching over the JS parsing to use the Google Closure JS parser rather than the Rhino one, which has been giving a lot of problems recently.#2019-05-0613:24polymerisThat's great to hear, cfleming. Thanks!#2019-05-0417:50polymeris(where "foo" is in node_modules)#2019-05-0417:53polymerisAdding node_modules as src folder doesn't seem to help#2019-05-0507:53p-himikIs there any way to debug compiled classes created by compile function from a CLJ source?
I see some magic - a function calls another function with a not-nil argument, and the callee still receives nil. I see that the call stack includes 2 levels for each function call, so there must be something fishy going on in there.#2019-05-0509:26p-himikHere's a piece of code of interest:
(defn write
"Writes a value to a transit writer."
[^Writer writer o]
(.write ^com.cognitect.transit.Writer (.w writer) o))
When the current line is the very first one, writer is not null. But as soon as I step into , it becomes null for no apparent reason.#2019-05-0509:38p-himikAhh, the value there is not actually null - the NPE is in the .write function, a step further.
But why does the debugger report null here? I'm in the debug mode, so locals should not be cleared. Let alone locals in the current frame.#2019-05-0513:34vemvMaybe you got bit by https://clojure.org/reference/compilation#_locals_clearing ?#2019-05-0514:12p-himikI have -Dclojure.compiler.disable-locals-clearing=true in my :jvm-opts, and the corresponding button in the debug REPL is pushed in, so that shouldn't be it.#2019-05-0522:35cfleming@U2FRKM4TW That definitely sounds like locals clearing. Note that locals clearing is a compile flag, it has to be set when you compile your code. If you’re loading from source then having it set in your runtime is sufficient since your code will be compiled when it’s loaded, but if you’re AOT compiling you’ll have to either set the flag before compiling or re-evaluate your code (i.e. re-send the file to the REPL) to have it be recompiled taking the flag into account.#2019-05-0522:46p-himikHmm, there's a change it was indeed AOT. Thanks!#2019-05-0601:47steveb8n@cfleming loving the new html->hiccup translation feature. saves lots of time when experimenting with UI ideas#2019-05-0602:25cfleming@steveb8n Great, thanks! Glad it’s helping.#2019-05-0611:28mhuebertwhen I am working with local libs, I find that I need to put a clojurescript dep in each deps.edn (eg. {org.clojure/clojurescript {:mvn/version "1.10.520"}}), otherwise that library’s source files will be filled with undefined vars like defn, defprotocol etc. Is this just the normal/expected behaviour?#2019-05-0702:24cfleming@mhuebert I think so, yes. I wouldn’t expect deps itself to work otherwise.#2019-05-0702:29cflemingActually, thinking about it, I’m not sure that’s true. If you have a deps project app which uses another one called lib via :local/root, and the contents of lib are only ever required from app (i.e. you never run a REPL or anything directly from lib), then I guess that might work. I can’t think of a good way to handle that in Cursive though.#2019-05-0702:30cflemingOne way to do that would be to have the extra deps in a :cursive alias or something? Still a bit icky though.#2019-05-0707:12mhuebertFair enough#2019-05-0810:04p-himikAnother alternative is to override user deps.edn with another one that contains the required dependency. According to settings, it's a per-project parameter. But it still may be considered ever more ickier than the alias way.#2019-05-0810:16Jakub Holý (HolyJak)Does Cursive have support for test.check? Out of the box it has wrong indentation on prop/for-all, does not understand that it creates bindings (and thus complains about "... cannot be resolved"), bad indentation for defspec & doesn't understand it defines a new thing, thus complaining about its name "... cannot be resolved"). I googled out https://cursive-ide.com/userguide/testing.html but it does not mention test.check. Thank you!#2019-05-0810:31p-himikI know that it doesn't really answer the question, but you can Alt+Enter on any symbol in question and play around with "Configure indentation for [...]" and "Resolve [...] as..." I find that most of the time, it helps with such cases.#2019-05-0815:20Jakub Holý (HolyJak)Thanks, will try!#2019-05-0822:59cflemingYes, you should be able to fix those problems using the customisation, but test.check is popular enough that I should fix that.#2019-05-0823:00cflemingUnfortunately defspec works quite differently to existing test integrations and is hard to support well.#2019-05-0823:02cfleminghttps://github.com/cursive-ide/cursive/issues/2170#2019-05-0900:39wilkerluciohello, for some reason seems like my maven repositories just disappeared from the list in the maven options (so no dependency completion), does someone knows how can I get then back?#2019-05-0900:39wilkerlucionevermind, after doing a refresh on the deps project they went back 🙂#2019-05-0910:46dirklectischIs there a guide somewhere on how to setup a new project with Cursive using Clojure’s CLI tools and Clojure Deps?#2019-05-0911:17claudiuthink just opening the deps.edn trigger cursive to ask if it's a project and do the right things#2019-05-1000:16cfleming@U0520QSJJ This is the closest thing until I get the doc up to date: https://groups.google.com/d/msg/cursive/NQIJzhGjfEY/hdNXUco8CgAJ#2019-05-0921:04misha@cfleming hi! Colin, did you think about leveraging IDEA's javascript plugin to resolve (do not show as unresolved, etc,) js/dom related methods?
this is the file I am talking about:
/Applications/IntelliJ
however, I think it might not be available in community edition of IDEA.#2019-05-1000:18cfleming@U051HUZLD Not exactly, but I’m currently working on migrating the JS parsing to the Google Closure parser, and as part of that I’m going to use their equivalent: https://github.com/google/closure-compiler/tree/master/externs#2019-05-1006:09mishaNice! Thanks!#2019-05-0921:06misha(17307 lines)#2019-05-0921:22henryw374trying to use cursive with a deps project to run an nrepl repl with middleware.... and failing . I have an alias with :
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.piggieback/wrap-cljs-repl]" "-i"]
which works ok running clj from the command line, but running with cursive the middleware is not getting picked up. I have tried various repl options, including nrepl with the the alias that includes the line above. anyone knows how to make this work?#2019-05-1000:20cfleming@U051B9FU1 Do you have the alias specified in your run configuration? You need to have “Run with Deps” selected there and the alias in the Aliases box.#2019-05-1008:32henryw374Hi, yes I just have the one alias in the run config, using 'run with deps' and 'nrepl' opt selected.
the main-opts is being read, which I know because if i put some rubbish in there i get an error.
for a minimal repo:
:dev {
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.piggieback/wrap-cljs-repl]" "-i"]
:extra-deps {
com.bhauman/figwheel-main {:mvn/version "0.2.0"}
nrepl/nrepl {:mvn/version "0.6.0"}
cider/piggieback {:mvn/version "0.4.0"}
}}
then in the repl:
(require 'figwheel.main)
(figwheel.main/bound-var? 'cider.piggieback/cljs-repl-env)
=> false
but when starting a repl from`clj -Adev`, the above evaluates to true#2019-05-1008:32henryw374I tried taking out nrepl as a dependency, but that makes no difference from cursive#2019-05-1021:44cflemingThanks, I’ll try to reproduce that#2019-05-1412:39henryw374thanks. If we can get that going then moving our projects to deps becomes a possibility. The other way would be to run a headless repl and remote to it from cursive I guess, but then you'd miss out on the cursive repl goodies afaik#2019-05-1413:28flowthingI don't think you miss out on anything by using a remote REPL. I can't think of anything, at least.#2019-05-1415:02henryw374I was thinking test integration, macro expansion... but true you don't really need those in a process that's mostly there just to compile cljs#2019-05-1417:09flowthingI think test integration works, at least.#2019-05-1423:31cfleming@U051B9FU1 All of that will work fine with a remote REPL. Really the only difference is it’s mildly more annoying to start (i.e. you have to start the server and then run the REPL within Cursive).#2019-05-1508:01henryw374ok thanks#2019-05-0923:40nwjsmithIn clojure.test there are thrown? and thrown-with-msg? “special assertions”. Is there any way to convince Cursive to resolve these?#2019-05-1000:29kennyI don't think so: https://github.com/cursive-ide/cursive/issues/238#2019-05-1001:20nwjsmithThanks!#2019-05-1003:16cflemingUnfortunately not, these use some funky multi-method black magic that’s hard to resolve accurately.#2019-05-1412:39henryw374thanks. If we can get that going then moving our projects to deps becomes a possibility. The other way would be to run a headless repl and remote to it from cursive I guess, but then you'd miss out on the cursive repl goodies afaik#2019-05-1011:29roklenarcicI am looking at Code Style -> Clojure settings and Form Parameters tab#2019-05-1011:30roklenarcicthere I have a dropdown for each form, I can pick Indent or a number#2019-05-1011:30roklenarcicwhat does that do?#2019-05-1011:31roklenarcicIf I break (form x) into having x in new line, then I always get 2 character indentation#2019-05-1011:31thumbnaili think it uses your global ident-setting or a fixed indentation amount#2019-05-1011:32roklenarcicNo I mean why when I set this to 0, I still get same indentation than when I set this to 8#2019-05-1011:34roklenarcicLike I set assoc value to 8 and when I linebreak I get this:
(assoc
:a
1
2)
#2019-05-1011:35ikitommi@cfleming about the error when after switching project, nothing gets resolved. Got it again and in the logs:
2019-05-10 14:29:42,175 [26173294] INFO - pl.projectlevelman.NewMappings - VCS Root: [] - [<Project>]
2019-05-10 14:29:42,175 [26173294] INFO - pl.projectlevelman.NewMappings - VCS Root: [Git] - [/Users/tommi/projects/metosin/spec-tools]
2019-05-10 14:29:42,213 [26173332] INFO - ellij.project.impl.ProjectImpl - 209 project components initialized in 70 ms
2019-05-10 14:29:42,235 [26173354] INFO - le.impl.ModuleManagerComponent - 1 module(s) loaded in 21 ms
2019-05-10 14:29:42,265 [26173384] INFO - rojectCodeStyleSettingsManager - Initialized from default code style settings.
2019-05-10 14:29:42,329 [26173448] INFO - PerformancePlugin - Performance Plugin is in silent mode
2019-05-10 14:29:42,387 [26173506] INFO - .diagnostic.PerformanceWatcher - Pushing properties took 18ms; general responsiveness: ok; EDT responsiveness: ok
2019-05-10 14:29:42,511 [26173630] INFO - il.indexing.FileBasedIndexImpl - Rebuild requested for index ClojureSymbolMeta
java.lang.Throwable
at com.intellij.util.indexing.FileBasedIndex.requestRebuild(FileBasedIndex.java:70)
at cursive.intentions.resolve$rebuild_all_indexes_BANG_.invoke(resolve.clj:142)
at clojure.lang.Var.invoke(Var.java:383)
at cursive.api.DelayedFn.invoke(DelayedFn.java:36)
at cursive.settings.ClojureProjectResolveSettings$loadState$1.run(ClojureResolveSettings.kt:95)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:311)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
#2019-05-1011:37ikitommi2019.1.2, cursive v1.8.2-eap2-2019.1#2019-05-1013:41Ben HammondCode Formatting seems to have changed.
I'd like to align parameters thus
(defn bar
[a b c]
(* a
b
c))#2019-05-1013:42Ben Hammondin cljs#2019-05-1013:47Ben Hammondhmmm; the new tool looks alot more powerfull#2019-05-1013:48Ben Hammondif only I knew how to use it.
whata is the differeence between 'Indent' and 'Function'?#2019-05-1014:57sashton;; function
(some-var
1
2)
(some-var 1
2)
;; indent
(some-var
1
2)
(some-var 1
2)
#2019-05-1015:01sashtonI understand indent to be used for def-like things. Where you’d like the second line to always be indented, regardless how many arguments are on the first line.
Whereas function is typical for regular function-type vars, and will line up arguments vertically if you leave any on the first line.#2019-05-1013:53Ben Hammondhttps://cursive-ide.com/userguide/formatting.html just says
Coming Soon: A much better way to do this.#2019-05-1014:57mbjarlandI have a question, I quite often find myself in a situation where I need to write an ad-hoc clojure snippet to be run from the command line to do someting like analyze a large xml file, search through a directory structure for patterns, analyze an apache log etc. In this situation I do want the intellij repl experience, the intellisense, goto declaration etc, but I do not want to spend five minutes setting up a project...and also, it seems that projects like their source to be in a separate directory from the project root which is not great in this scenario either.
So open question, do other people do these kinds of ad-hoc scripts and if so, do you use intellij/cursive for it and in that case how?
Sometimes the scripts need a deps.edn as well, so supporting that would be a bonus. Right now I'm thinking I will create one project called lets say ad-hoc and use it for all scenerios like this, but perhaps there is a better way?#2019-05-1015:25Alex Miller (Clojure team)I spend 5 minutes and make a project#2019-05-1015:26Alex Miller (Clojure team)Half the time I end up enabling git or doing more later on, so just seems easier to bite the bullet#2019-05-1015:26Alex Miller (Clojure team)With a deps.edn project, there’s almost nothing to set up#2019-05-1015:32mbjarlandok. Thanks for the input @alexmiller...and thanks for all the great articles and your general contribution to the community. Much appreciated.
I end up doing a lot of small scripts like this in my day job, often driven by a hate for bash for anything more complex. So say I just create an empty dir with a deps.edn and my script, I know I've previously caved in and ended up creating a src dir just to have cursive understand my source. Is this necessary or can you leave the script in the root and still make cursive grok it? I ask also because I would like to have the deps.edn and the script in the same dir as it makes it more trivial to run them directly via clj. I can hear myself being nit picky here but it has been bothering me for a while.#2019-05-1022:00cflemingTo those above asking about indentation (@ben.hammond, @saskia, @roklenarcic and others), my apologies for not having this better documented. Here’s how this works:#2019-05-1022:05cflemingMacro forms will often have some number of parameters, followed by any number of body forms. Consider condp:
(condp pred expr
test result
...)
condp can be considered to have two arguments, and then its body. This means that its indent value is 2 - it has two parameters that should be indented differently to the rest.#2019-05-1022:06cflemingGenerally, the parameters are aligned, which means that you’ll get e.g. this:
(condp pred
expr
test result
...)
#2019-05-1022:07cflemingSo if there’s a line break between the parameters, they will be aligned. All the “body” elements (i.e. elements after the parameter count) are just indented two spaces.#2019-05-1022:08cflemingThe default indent is two spaces, so if you have a line break before the first parameter, you’ll get this:
(condp
pred
expr
test result
...)
#2019-05-1022:12cfleming“Only Indent” is for people who don’t want to think about any of this, and just always want two-space indent after a line break. This is also often useful for forms like proxy, defrecord, extend-protocol and the like. There’s also a setting Preferences | Editor | Code Style | Clojure | General | Default to Only Indent which sets that for all forms which don’t have an explicit setting. See Nikita’s great article on why you might want that: https://tonsky.me/blog/clojurefmt/#2019-05-1022:13cfleming“Function” is usually the default, and treats all form elements after the head as parameters and aligns them, i.e. functions have no body. This is why you’ll get:
(my-fn a
b
c)
#2019-05-1022:14cflemingAgain, with a line break before the first param, params will be indented 2:
(my-fn
a
b
c)
#2019-05-1022:16cflemingCursive’s “Only Indent” setting also implements the improvement for parinfer compatibility that tonsky discusses in recent Cursive versions.#2019-05-1022:31nwjsmithOooooh cool. I’ve been meaning to give Nikita’s suggestion a try, this will make it really easy. Is there a way to do this per-project?#2019-05-1022:31nwjsmithMy coworkers will have choice words for me if I use this, but on my personal projects I’m freeee#2019-05-1102:39cfleming@nwjsmith Yes, in Preferences | Editor | Code Style | Clojure set Scheme to Project.#2019-05-1107:18Kari MarttilaI found something weird and I'm not sure if I just don't understand how to use REPL or is this a Cursive issue or what. A short explanation.
I have mydev.clj in which I keep all kind of development time stuff like:
(defn reset []
"Resets REPL and starts server."
(log/debug "ENTER reset")
(mount/stop)
(ns-repl/refresh :after 'mydev/start))
I.e. to be able to stop mount states and then refresh everything and start mount states again. I have e.g. my configuration in mount: simpleserver.util.config/config-state (basically reads the configuration from file).
Then the weird part.
I have a scratch file in IDEA in which I send expressions to REPL with Cursive hot key (Send form before caret to REPL), e.g.:
(mydev/reset)
simpleserver.util.config/config-state
I.e. I first refresh everything and then check the config that my new configuration changes are there. But they are not.
BUT: If I go into the actual REPL input window and write those lines there and send them to REPL I can see my configuration changes.
This really puzzles me - have I understood something wrong since I thought that the result should be same with both scenarios (send the expressions to REPL using hot key and writing the same expressions in REPL window and sending them to REPL for evaluation there).#2019-05-1107:27Kari MarttilaI think I got it now but I still don't understand the behaviour. The REPL output window says in the first screnario (when I'm sending the expressions with hot key from scratch file):
2019-05-11 10:23:06 DE [nRepl-session-a9d217fb-3d2c-4016-aae3-7e37ca090cc5] DEBUG mydev - ENTER reset
2019-05-11 10:23:06 DE [nRepl-session-a9d217fb-3d2c-4016-aae3-7e37ca090cc5] DEBUG mydev - ENTER stop
2019-05-11 10:23:06 DE [nRepl-session-a9d217fb-3d2c-4016-aae3-7e37ca090cc5] DEBUG mydev - ENTER start
2019-05-11 10:23:06 DE [nRepl-session-a9d217fb-3d2c-4016-aae3-7e37ca090cc5] DEBUG simpleserver.util.config - ENTER create-config
:reloading ()
=> Mount starts and only after that the reloading is happening.
In the second scenario (I write the expressions in the REPL input window):
2019-05-11 10:23:16 DE [nRepl-session-a9d217fb-3d2c-4016-aae3-7e37ca090cc5] DEBUG mydev - ENTER reset
2019-05-11 10:23:16 DE [nRepl-session-a9d217fb-3d2c-4016-aae3-7e37ca090cc5] DEBUG mydev - ENTER stop
:reloading ()
=> {:started ["#'simpleserver.util.config/config-state"]}
2019-05-11 10:23:16 DE [nRepl-session-a9d217fb-3d2c-4016-aae3-7e37ca090cc5] DEBUG mydev - ENTER start
2019-05-11 10:23:16 DE [nRepl-session-a9d217fb-3d2c-4016-aae3-7e37ca090cc5] DEBUG simpleserver.util.config - ENTER create-config
=> First REPL is reloading and after that mount starts (and gets the new configuration since we reloaded the namespaces...)#2019-05-1107:29Kari MarttilaWhat really puzzles me is that I thought these two scenarios should be exactly the same: either sending the exact same expressions from scratch file to repl using hot key, or actually writing the expressions in repl input window and sending the expressions there.#2019-05-1107:49Kari MarttilaThe server code is here if you are interested: https://github.com/karimarttila/clojure/tree/master/webstore-demo/simple-server (commit: 88631bb54069c25e80fc0fa9e4cc1670fe6a7f47 ) => in dev-src/myscratch.clj is the scratch file I was talking about. You can demonstrate this by changing e.g. the port number in resources/config/dev/config.edn and then doing the reset and checking the config-state first sending those expressions from the scratch file to repl and then writing the same expressions in the repl input window.#2019-05-1107:51Kari MarttilaWell, I'm glad I figured out that I can use this "reset" workflow in the REPL input window, but I'm not really content regarding this "workaround" since I understood e.g. from one REPL presentation that the best practice is not write stuff in REPL but write stuff in some scratch file and send the stuff for evaluation to REPL.#2019-05-1107:55Kari Marttila... and BTW. I really love Cursive and I have the commercial Cursive version bought to me by my corporation (I can provide the License ID privately if needed).#2019-05-1109:34joshkhare there tools to provide performance details of all functions called from a parent function at runtime? i have a function that kicks off loads of queries, calculations etc. i could time each function but wasn't sure if there's a way to time them automatically.#2019-05-1109:46joshkhwhoops, wrong channel 😇#2019-05-1117:12maximtopI can't setup repl in cursive for this project https://github.com/lispcast/understanding-re-frame by this description
https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL
What may I be missing?#2019-05-1117:15maximtopI get this error#2019-05-1117:16maximtopand here is the configuration window#2019-05-1118:22ericnormand@maximtop does it work if you run it at the command line?#2019-05-1118:22maximtopYes#2019-05-1118:23maximtopHm, I am not sure
You mean if I run at the command line lein repl after setup described in the instruction?#2019-05-1118:32maximtopIf I run lein repl from the command line than there is an error#2019-05-1119:01maximtop@ericnormand#2019-05-1119:56flowthingTry changing the cemerick/piggieback dependency to [cider/piggieback "0.4.0"]. #2019-05-1119:58flowthingMight also need to use [nrepl "0.6.0"].#2019-05-1120:00maximtopThere is no nrepl or cemerick/piggieback dependency in the https://github.com/lispcast/understanding-re-frame
#2019-05-1120:01flowthingAnd cemerick.piggieback/wrap-cljs-repl -> cider.piggieback/wrap-cljs-repl.#2019-05-1120:01flowthingPiggieback is under dev dependencies.#2019-05-1120:01flowthing nREPL might be a transitive dep.#2019-05-1120:10maximtopI've added dependencies
[cider/piggieback "0.4.1-SNAPSHOT"]
[figwheel-sidecar "0.5.19-SNAPSHOT"]
and changed
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}
now lein repl starts fine from the command line
but I still can't start repl from cursive with the same error I've pasted above#2019-05-1120:27flowthingYeah, that looks like something unrelated, haven’t seen that before.#2019-05-1120:40maximtopthank you for trying to help me#2019-05-1207:40maximtopSeems that Emacs for clojure/clojurescript development is inevitable#2019-05-1210:04flowthing@maximtop You could try selecting nREPL instead of clojure.main in the config dialog and removing script/repl.clj from the parameters (I don’t know why that’s there, though).#2019-05-1210:33maximtop@flowthing
Yes, I've managed to launch cljs repl from the Cursive via nREPL
I've started nREPL from command line lein repl
and connected to the nREPL via Cursive remote repl
after that I have run in REPL these commands
(use 'figwheel-sidecar.repl-api)
(start-figwheel!)
(cljs-repl)
It would be perfect if there be some possibilities to not type them every time#2019-05-1215:10flowthingThe typical way would be to add dev/user.clj, add a function that calls those things, and add ”dev” into project.clj :source-paths. Then just call that function when you open a REPL.#2019-05-1215:11flowthinghttp://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded#2019-05-1215:11maximtop👍 Ok, I'll try this. Thank you#2019-05-1219:13Lennart BuitI created a new cljs project with a deps.edn, but cursive can’t resolve defn and println, can I fix that somehow?#2019-05-1219:24Lennart Buitah nevermind, I needed to add clojurescripts to the deps key in deps.edn, instead of extra-deps#2019-05-1222:19Jakub Holý (HolyJak)Any tips regarding Cursive, deps.edn and extra-paths from additional aliases, ignored by cursive? I have an alias "specifications" with the extra path "specifications/code", containing the namespace "specifications.invoice". I have configured IntelliJ - Preferences - clojure Deps - Aliases to enable by default by changing it to specifications,test. Even after a restart, when I open the namespace, IntelliJ doesn't show the code directory as a source/test directory and complains "File invoice.clj is not under a source root."
Is it so that only the "test" alias is fully supported regarding extra paths? Any tips? Thank you!#2019-05-1222:20cfleming@holyjak That should be fixed in the latest EAP build, 1.8.2-eap2#2019-05-1222:22Jakub Holý (HolyJak)You are incredibly quick 🙂#2019-05-1222:23cflemingI just happened to be here and haven’t started clearing out the channel backlog yet 🙂#2020-01-2820:48madstapSometimes cursive seems to indent maps like this:
{[: :]
{,,,}
[: :]
{,,,}}
which I'd expect to be indented like:
{[: :]
{,,,}
[: :]
{,,,}}
Is there a setting for this?#2020-01-2821:08cflemingNo, that looks like a bug to me. Could you file an issue with a reproduction case?#2020-01-2821:34madstapYeah, I'll do it tomorrow as it's a coworker and not me.#2020-01-2905:26dpsuttonI redownloaded cursive and intellij and started relearning. I put in my community license but it expired at the end of 2019. Cursive suggests i can renew this, so i follow that workflow on the site. However, the renewal process tells me that this is a non-commercial license not a personal one but there doesn't seem to be an option to select this. The only two renewal options are personal or commercial. Are non-commercial licenses not eligible to renewed despite the UI inviting me to or have i missed an option in the renewal UI?#2020-01-2907:31cflemingNo, non-commercial licences don’t get renewed, you just get a new one when they expire.#2020-01-2907:31cflemingSince they’re free anyway, this seemed like the easiest option. Was there something in the UI suggesting that it should be renewed?#2020-01-2913:34dpsuttoni just looked at the event log and i must have misread it as saying "renew". I swear i read the verbiage 8 times. yeah you're correct it just says get a new one#2020-01-2913:35dpsuttonthe event log says get a new one. I am almost positive that the popup in the bottom right told me to renew. but maybe not#2020-01-2921:32cflemingNo, what appears in the event log is the same text as the notification.#2020-01-2923:11dpsuttonah sorry about that then 🙂#2020-01-3010:32simongrayI can’t for the life of me get Cursive to connect to the nrepl that shadow-cljs has created. Any help? This is a surprisingly hard problem to google despite the fact that the shadow-cljs dev apparently uses Cursive himself.#2020-01-3010:32thhelleryou likely want to configure a fixed port via https://shadow-cljs.github.io/docs/UsersGuide.html#nREPL#2020-01-3010:33simongrayYou really are everywhere! Thanks, but this is exactly what I’m doing, but Cursive just hangs with Connecting to remote nREPL server...#2020-01-3010:34thhellerdid you restart shadow-cljs? port changes require a restart#2020-01-3010:35thhellerit should print the port it used on startup#2020-01-3010:39simongrayOk, for some reason it wasn’t but now it does seem to work. Now the issue is that the code I put in my starting CLJ namespace doesn’t seem to get run…?#2020-01-3010:40simongray(ns dev
(:require [shadow.cljs.devtools.api :as shadow]))
(shadow/watch :app)
(shadow/repl :app)
#2020-01-3010:40simongrayI need to run it myself in the REPL I connect to in cursive#2020-01-3010:42thhellerthis won't work#2020-01-3010:42thhellernREPL doesn't allow it#2020-01-3010:43thhellermake it a (defn [] (shadow/watch ...) ...)) and call that manually once#2020-01-3010:43thhellerbind it to a keyboard shortcut in cursive#2020-01-3010:43simongrayI see. Thank you for the instant support!#2020-01-3010:43simongrayand thank you for making shadow-cljs#2020-01-3010:32thhellerand then use cursive repl -> remote -> localhost:that-port#2020-01-3010:33thheller(and yes I do use Cursive) 🙂#2020-01-3010:34thhellerhttps://github.com/cursive-ide/cursive/issues/2216 should make that easier so Cursive can read the port shadow-cljs used without configured it#2020-01-3015:09Jakub Holý (HolyJak)Hello! Does Cursive understand shadow-cljs npm imports like
(ns mine
(:require
["@telia/styleguide" :as styleguide]
["@telia/styleguide/assets/allicons/AllIcons" :default AllIcons]))
(AllIcons)
? It currently complains that styleguide and AllIcons "cannot be resolved"#2020-01-3015:11thhellerit does not#2020-02-0614:08frankiesardo@U05224H0W do you use Cursive yourself? Is this something that makes using shadow-cljs cumbersome?#2020-02-0614:10thhellerI do use Cursive yes. I disabled that particular warning so it doesn't bother me.#2020-02-0615:39frankiesardoThank you for your answer! Can you also share how do you disable that warning?#2020-02-0616:51thhellerI actually can't remember. I disabled several years ago. Somewhere in the options you can toggle which warnings to show or how to format them#2020-02-0617:04frankiesardoNp, I'll keep digging 🙂#2020-01-3018:54kennyThe args for a function are misaligned.#2020-01-3022:17cflemingThanks, I’ll check that and see what’s going on.#2020-01-3109:22Jakub Holý (HolyJak)Hello! Is there a way to tell Cursive to not indent arguments based on the previous argument but to always ident them by 2 spaces (for a given macro)? I know about "configure indentation" but this macro has 3 optional arguments and the body so setting a fixed number does not help. This is what I want:
(div
"Hello"!)
(div {:id "mydiv"}
"Hello"!)
(div :.red.welcome {:id "mydiv"}
"Hello"!
(strong "there!")#2020-01-3109:47cflemingSee here: https://cursive-ide.com/userguide/formatting.html#code-style-settings - “Only indent” is the option you want.#2020-01-3110:42Jakub Holý (HolyJak)thanks a lot!#2020-01-3119:50Wilson Velezhi, the autocomplete function is not working for me. what can I do to fix it? please#2020-01-3120:00Wilson Veleznor even the documentation pop is working.#2020-01-3121:26Wilson Velezit is related with shadow, I hove another project in lein and it works fine#2020-02-0103:54cflemingDid you follow this and import a POM? https://shadow-cljs.github.io/docs/UsersGuide.html#_cursive#2020-02-0312:46misha@cfleming do you use your own code format implementation or something open source?
all I really need is a function to make maps like this:
{:a 1
:aa 2}
into this:
{:a 1
:aa 2}
clojure's pprint does not really do this : (#2020-02-0313:04imre@misha have you checked https://github.com/weavejester/cljfmt ?#2020-02-0317:04jvtriguerosAlso, cljstyle, which is a fork of cljfmt but compiled to GraalVM
https://github.com/greglook/cljstyle#2020-02-0319:17mishaI did, but it did not seem to work within time I spent playing with it. and all the docs are conveniently contain let forms with single char binding names, like
(let [x 1]
y 2])#2020-02-0313:17manutter51If you just need a function you can use this:#2020-02-0322:33mishathank you.
but the use case is arbitrary data structures (e.g. maps with vectors of maps, etc), which has to be pretty-printed, so simplistic implementation will not cut it, (where e.g. cursive's "format selection" seems to be a fit). And 2 pages of custom code not worth it in this case.#2020-02-0401:39manutter51Yeah for arbitrary data structures that's a no-go, I thought you just wanted a simple data dump.#2020-02-0323:10cfleming@misha Well, it’s open source, but probably not what you mean - it’s the IntelliJ code formatter, with extensions for Clojure code from Cursive. As you’ve found, some apparently-simple cases are decidedly non-trivial. I can make your case even more non-trivial by doing this:
{{:a 1
:aa 2} 3
:b 4}
#2020-02-0323:12cflemingFor these reasons, IntelliJ’s code formatter uses a constraint algorithm with multiple passes until a solution converges, which is required for this sort of case. Cursive actually never breaks lines, which means that a simpler algorithm might suffice, but I might start breaking lines at some point, and then a naive algorithm gets extremely hard: https://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written/#2020-02-0323:21kennyThere's no way to use Cursive's test diffing when running CLJS tests, right?#2020-02-0323:22cflemingNo, sadly - that requires Cursive to understand CLJS REPLs better, which I’m struggling to get around to.#2020-02-0323:23kennyWell, in this case I don't really need to know anything CLJS specific. A cljc function returns a large structure that is just regular data. It's hard to eyeball what is different. Since it's regular data, it seems like Cursive's diff UI would "just work"#2020-02-0323:24kennyI guess I could go make a temporary .clj test file, paste the failing test, and then run the test haha#2020-02-0323:49cflemingIt’s not the diff that wouldn’t work, it’s the getting the data back from the test framework via the CLJS REPL. I actually also have plans to allow diffing of arbitrary structures from the REPL (something like (cursive.runtime.repl/diff first-thing second-thing)), but that also requires some jiggery pokery to work.#2020-02-0400:09kennyOh I see haha. That's a cool idea! I support the jiggery pokery 🙂#2020-02-0403:50kennyIt seems my new projects are now all called "Imported From Deps". Can I change this to match the directory name?#2020-02-0403:50kennyI see a .name file that has "Imported From Deps"#2020-02-0403:51kennyChanging that and then reopening the project updated the name. I think Cursive used to set the parent name to the directory name though.#2020-02-0404:09cflemingYeah, that seems to have changed in 2019.3. Are you creating the projects in IntelliJ, or creating using the CLI and then importing?#2020-02-0404:09kennyI usually duplicate an existing project and then import.#2020-02-0404:10cflemingI see, interesting. I can’t always reproduce this, I’ll try that.#2020-02-0404:10kennyI try to always delete the .idea, any .iml and .git before importing.#2020-02-0404:11cflemingOk, thanks.#2020-02-0409:33d-t-wI'm finding Intellij 2019.3.1 and 2019.3.2 painfully slow, anyone else the same? To be clear I don't think it's a Cursive issue (though I guess it's possible). Super laggy scrolling through cljs files in the editor pane, super unresponsive with shortcut keys, seems to take forever to gain focus when switching into app. I'm fairly certain it's since I bumped up to 2019.3.x in early january.#2020-02-0415:00jumpnbrownweaselThat's my experience as well.#2020-02-0415:34jvtriguerosI was noticing that yesterday too, I've disabled almost all plugins too 😞#2020-02-0422:43cflemingI’ve noticed IntelliJ being laggy too, but it’s always difficult to tell on my dev machine since I run multiple instance of IntelliJ and debug a lot.#2020-02-0606:46d-t-wI can imagine that your Intellij setup might be a bit bonkers Colin! I'm putting it down to suuuuper poor performance regression since the 2019.3.1 update.#2020-02-0606:46d-t-wWorst bug report ever, like when I went to the doctor at Uni and said "I'm just like, suuuuuper tired".#2020-02-0410:36imreIs there a bindable command to show expected/actual difference after a failed test run? I would love not having to hover-scroll-click#2020-02-0423:52cflemingNo, but it’s on my list, you’re right that that is very annoying.#2020-02-0609:45onetomi started using F2 for that purpose actually.
discovered it accidentally 🙂
it's jumping to other locations too, but includes this use-case too#2020-02-0609:50imreThat would be the "Next nighlighted error" command, wouldn't it?#2020-02-0609:53imreI do have that bound, and it does bring up the hover window, however inside the hover window there's a link at the bottom saying "Show difference". When you click that, it will show the diff in Idea's diff viewer which is quite handy for large diffs. I'm looking for a way to invoke "Show difference" with the keyboard#2020-02-0721:10onetomYeah, that show difference action was not exposed as a bindable function the last time I asked about it a few months ago.#2020-02-0415:37ghadiDoes cursive have infra to support tap> ?#2020-02-0423:52cflemingNot at the moment, no. What would you like to see?#2020-02-0500:15ghadiOne of our customers was asking about debugging a long ->> pipeline, and I suggested to comment out all the steps he didn’t want to run, but a step that called tap> would be more useful#2020-02-0500:16ghadiDunno, the easy thing would be to print the data to the repl but you can already do that today#2020-02-0500:16ghadiMaybe a viz of some sort#2020-02-0500:19cflemingYeah, I’m planning on adding a data inspector so that might be a good candidate. My socket REPL support is sort of prepl-y but also has structured input, so I could potentially do things with tap values on the Cursive side there too#2020-02-0609:47onetomi just use the dbg macro from this library usually:
https://github.com/philoskim/debux#debugging-thread-macro-or#2020-02-0417:10DavidIf I (:require [clojure.test :as t]) in a -test.cljs file, Cursive marks 't' as unused--even when t is clearly used. If, instead, I (:require [cljs.test :as t]), then Cursive doesn't complain.#2020-02-0423:53cflemingInteresting, I haven’t seen that. I’ll check that I can reproduce that and fix it.#2020-02-0500:37DavidThanks!#2020-02-0500:37DavidIf you have any problems reproducing, let me know.#2020-02-0417:11DavidIs there something I can do make Cursive recognize the clojure.test usage?#2020-02-0421:48samI’m using tools.deps with Cursive. I have the following alias that I’m trying to use with the cursive repl.
{:repl {:main-opts ["-i" "aot.clj" "-r"]}#2020-02-0500:02cflemingSomeone mentioned this to me a while back. I thought I had investigated but I can’t find my notes now. I’ll take another look.#2020-02-0521:46samThanks @U0567Q30W, let me know if I should file an issue.#2020-02-0601:42cflemingActually, if you could that would be great, then it won’t get lost again.#2020-02-0421:49samEven though I added :repl to Aliases, it seems that aot.clj is not getting run like I expect it to when starting the repl.#2020-02-0421:54samWhen I use clojure.main instead of nrepl, aot.clj runs as expected. Is main-opts not supported for nrepl? I need to do some AOT compilation every time the repl starts and I’d rather not make devs have to remember to do a separate step. Is there a better way to do this?#2020-02-0609:52onetomis there a way to have the destructuring recognized in the more-of form of the clojure-expectations library?
https://clojure-expectations.github.io/templating.html
my use-case looks like this:
(more-of {:keys [txn-eid tag-eid]}
some-txn-eid txn-eid
(entid [:tag/name "tag"]) tag-eid)
can i use the Specify... choice somehow in this case?#2020-02-0620:34cflemingI can’t think of anything existing that looks like that, sorry.#2020-02-0612:19frankiesardoHello, this may have been asked before but I can't find any resources online. How do I get Cursive to recognise node modules?#2020-02-0615:57frankiesardoYou can't https://clojurians.slack.com/archives/C0744GXCJ/p1580397107063000#2020-02-0620:34cflemingRight, currently it doesn’t but I’m going to fix that soon, for some value of soon.#2020-02-0612:28mhuebertIs there a way to “print” forms to a Cursive REPL such that they will be formatted the same as when one directly sends a form to the repl from the editor? (if I run (pprint some-thing), it ends up printed in a single line)#2020-02-0612:42mhuebertI also tried https://github.com/razum2um/aprint, it too results in a one-line print#2020-02-0612:45mhuebertit prints nicely if I send the form (aprint a-thing) to the repl, but not if (aprint a-thing) is evaluated from my program#2020-02-0613:13mhuebertFurther searching into the wormhole leads me to believe this has more to do with clj logging config than cursive#2020-02-0614:33mhuebertnvrmind got it sorted#2020-02-0616:33onetomi used https://github.com/kkinnear/zprint with some success.
i even customized it's color scheme to make it more readable on the light intellij theme.
unfortunately the ansi escapes are sometimes leak out in the output, but still pretty usable within cursive.#2020-02-0616:35imreif it's for debugging, https://github.com/weavejester/hashp could also be an option, I'm literally using it right now#2020-02-0616:58onetomthanks, this looks great too!#2020-02-0617:02onetomhow would u use it in a threading macro though?#2020-02-0617:09onetomseems like u can't really do that 😞#2020-02-0617:56imreyeah that won't work sadly#2020-02-0705:29onetomis there a list of the supported symbol resolution forms?
i might be able to pick one for the expectations.clojure.test/more-of form, but i can't find the right one without seeing all the options with some example syntax#2020-02-0921:46cflemingThere isn’t, no, although it’s a good idea.#2020-02-0901:52Ivan Kozany ideas what should i do for Core.main to be resolved properly?
https://gyazo.com/aba49b0e913aeece5600e594264bec9b.png#2020-02-0921:45cflemingCursive isn’t able to do this at the moment, it only has very limited understanding of gen-class.#2020-02-1009:08Ivan Kozalright ty#2020-02-1101:54kennyIs there a way to def a variable in the debugger?#2020-02-1101:56kennyFor example, say I'm paused here. Can I def the metrics variable, resume the program, and access my def'ed var in the regular REPL?#2020-02-1101:56kennyFWIW, this is useful because working in a regular REPL is far nicer than working in the evaluate expression repl.#2020-02-1101:57kennyOh, maybe I can just def a variable using the evaluate expression repl 😯#2020-02-1101:58kennyThat worked! I think it'd be nice to have a button like REBL has for doing this sort of thing: https://raw.githubusercontent.com/cognitect-labs/REBL-distro/master/screenshot.png#2020-02-1101:59dpsuttoni think tap might work nicely here as well?#2020-02-1102:00kennyMaybe? I haven't quite figured out how I'm supposed to use tap if I don't use REBL.#2020-02-1102:55cflemingYeah, I have some niceties around this planned for the debugger, including this and hopefully also keeping the normal REPL working but switching it to evaluate using the same mechanism as Evaluate Expression.#2020-02-1111:35imreWhy is Resolve ... as... -> Specify... -> clojure.core/comment not an option? There are some complicated macros in the codebase I'm currently working on and would like to disable static analysing the bodies of those.#2020-02-1121:29cflemingUgh, sorry, there was some discussion about this recently. There’s an issue, I’ve just moved this into the current milestone: https://github.com/cursive-ide/cursive/issues/1850#2020-02-1207:05imrenice, thank you#2020-02-1111:36imrewhen I try to enter clojure.core/comment, I get a var not found error#2020-02-1111:42imremanually adding it to options/ClojureResolveSettings.xml doesn't seem to work either 😞#2020-02-1114:07Ivan KozI'm trying to debug shadow-cljs exception, which is being started by lein, and having an issue. Whats going on here?
https://gyazo.com/feee3114d099052fe1fedb3522f35771.png https://gyazo.com/f8d7a6222af3087d61b5943ad7072ab6.png#2020-02-1121:25cflemingI think what is going on is that Cursive uses trampoline internally, and you’re explicitly using it there. Does it work without that?#2020-02-1121:25cfleming@UH16CGZC2 ^^#2020-02-1123:20Ivan Koz@U0567Q30W sorry i was sleeping, let me check#2020-02-1123:20cflemingNo worries, I just realised after writing the message that I hadn’t pinged as requested.#2020-02-1123:25Ivan Kozwow no way, i've tried every combination of trampoline arg and a checkbox, neither was working, but now it does as you said#2020-02-1123:26Ivan Kozthank you ^^#2020-02-1123:41cflemingNo problem! The secret is that Cursive always uses trampoline to execute lein stuff.#2020-02-1123:41cflemingWhich I see is only sort-of documented here: https://cursive-ide.com/userguide/repl.html#local-repls#2020-02-1114:13Ivan Kozi'm gonna run it directly for now, tag me if you have anything on that#2020-02-1117:09samI’m trying to “Use tools.deps directly”, but I can’t get it to download any versions of tools.deps. Clicking refresh has no effect. I tried looking in the idea log, but there don’t seem to be any relevant logs. Any idea what I’m doing wrong? Should I file a bug?#2020-02-1117:11samintellij version: 2019.3 Ultimate
Cursive version: 1.9.0-2019.3#2020-02-1117:13samAnd I’m on a mac#2020-02-1121:06samI was able to workaround by using “use private repo” and pointing to maven central.#2020-02-1121:27cfleming@UABEM258C This is a bug which is fixed in the latest EAP, there’s some description here: https://groups.google.com/d/topic/cursive/fItctBxneRk/discussion#2020-02-1121:28cflemingI’m hoping to get this into a stable release soon, but 2020.1 threw a bit of a spanner in the works.#2020-02-1123:49samOkay, thanks for the info.#2020-02-1303:39steveb8nQ: some of my projects automatically create modules for deps.edn local roots and others don’t. does anyone know how to force this to happen or to add modules for those that are missing?#2020-02-1307:10cflemingThere’s a bit of doc at the end of this bit talking about that: https://cursive-ide.com/userguide/deps.html#working-with-multi-module-projects#2020-02-1307:11cflemingThey’ll be automatically added if they’re required using :local/root#2020-02-1305:01gibbIf you're a IDEAVIM user this wiki page changed my cursive workflow for the better:
https://github.com/cursive-ide/cursive/wiki/Mapping-IdeaVim-actions-to-Cursive-actions#2020-02-1305:41Ivan Kozfor non IDEAVIM users, there is Actions Tree plugin
https://plugins.jetbrains.com/plugin/11076-actions-tree#2020-02-1310:16cflemingNice, for a simple version of that that doesn’t require a plugin, there’s also Quick Lists: https://www.jetbrains.com/help/idea/customize-actions-menus-and-toolbars.html##2020-02-1305:47Ivan Kozhttps://pastebin.com/raw/tzWDEBaj
my basic config#2020-02-1311:21imreUsing the latest Cursive EAP and idea 2019.3.3 I'm getting a previously unseen error on deps refresh:#2020-02-1311:21imre2020. 02. 13.
12:19 Errors during project resolution
The following errors were found during project resolve:
/Users/redacted/path/deps.edn:
Destination path "alsoredacted" already exists and is not an empty directory
#2020-02-1311:24imreand also#2020-02-1311:25imre12:24 Errors during project resolution
The following errors were found during project resolve:
/Users/redacted/path/deps.edn:
unable to find valid certification path to requested target
#2020-02-1311:32imreInvalidate caches/restart was the solution#2020-02-1319:09tanzoniteblackI have a multimodule project that relies on using tools-deps's local paths from the "top" module. When I use Load File in REPL from a clojure file in the src directory of one of the sub-modules, everything works fine, but if I attempt to do the same from a file in the test directory of a sub-module, I get an error that cursive can't load the file because it's not in scope for the module used to start the repl.
How can I make it so I can work on tests for submodules via only loading a single repl for the topmost module?#2020-02-1320:04cflemingHmm, this is tricky. With Deps, test code isn’t transitive, because aliases aren’t.#2020-02-1320:06cflemingSo Cursive is technically doing the right thing, because that code wouldn’t be available to your project running outside of Cursive either. Whether that’s a useful thing to enforce is another question.#2020-02-1320:07cflemingThe best solution I can think of would be to have a test-support module containing the shared test code in a src directory, and then depend on that from both modules. You could ask over in #tools-deps if there are any better solutions.#2020-02-1320:09tanzoniteblackis there any reason why adding the code to extra-paths shouldn't work?#2020-02-1320:11cflemingDon’t you get an error when doing that that modules can’t share source paths?#2020-02-1320:11tanzoniteblackI do get an error about that when I try to do it via intellij's module editor, yeah#2020-02-1320:11cflemingI’m pretty sure you should, because they can’t 🙂#2020-02-1320:11cflemingAre you refreshing your project after updating your deps.edn?#2020-02-1320:12tanzoniteblackI was adding that into my deps.edn from the top level project, so that the module actually does include that source path in it#2020-02-1320:12tanzoniteblackyep, I'm refreshing my project after updating the deps.edn#2020-02-1320:12cflemingHmm. IntelliJ should complain about that, because I’m pretty sure that’s not allowed.#2020-02-1320:14cflemingI’m not sure what the best solution is here, honestly. It’s a deps limitation (can’t easily share test code) mixed with an IntelliJ one (can’t have the same source in two modules). Is factoring the shared test code out into a third module an option?#2020-02-1320:17tanzoniteblackfile structure here:
API (deps.edn):
- src
- test
- project1 (deps.edn)
- src
- test
- project2 (deps.edn)
the entire project here, our monolithic API, is a single project. Some components of it are used in other projects as libraries, which is why it's broken out#2020-02-1320:18tanzoniteblackrealistically, the tests in all of the subprojects are just parts of the entire main project. I'd be perfectly happy to have the entire thing treated as a single project in intellij, but we do have the dependencies defined throughout the various subprojects#2020-02-1320:18tanzoniteblackso "shared test code" in this case just means tests in various sub-folders...which happen to have their own deps.edn#2020-02-1320:21tanzoniteblackI suppose that we can break out the tests into only the top level, instead of keeping them organized with the libraries, but it's going to annoy the rest of my team that we're restructuring our folder to workaround limitations in intellij/cursive, when they don't have these issues in emacs/cider.
Also, I'm fairly confident that I had worked around this bug previously using the :extra-paths hack I mentioned earlier. But, that might've broken when upgrading intellij at some point?#2020-02-1320:25tanzoniteblackgranted, just highlighting the whole file and sending that whole thing to the repl is also a valid work around#2020-02-1320:26tanzoniteblackwhich might be a "fix" that could be implemented in cursive? When a file isn't part of the module the repl was created in, just send the entire contents of the file to the repl instead?#2020-02-1320:27tanzoniteblackdoesn't fix the test integration though 😞#2020-02-1400:06cfleming> When a file isn’t part of the module the repl was created in, just send the entire contents of the file to the repl instead?
The problem with that is that this is the actually useful validation. I often have multiple REPLs open serving different functions, and I’ve been saved from loading code into the wrong REPL multiple times by that check.#2020-02-1823:51tanzoniteblack@U0567Q30W, I figured out why my original approach (just manually adding the test folder explicitly under :extra-paths in an alias) wasn't working.
Despite having the global setting Aliases to enable by default set to dev,test, dev wasn't being loaded as an alias for the project. I manually checked the box for dev in the aliases in the Clojure deps pane for the project and now I can load code & run tests in subproject just fine.#2020-02-1823:52tanzoniteblackI've no idea why it stopped loading that alias for my project. Doesn't seem to be loading dev alias for any of my projects by default, now that I'm looking at it closer#2020-02-1900:12cfleming@U236LQYB0 Oh interesting, thanks for that. I’m still not sure why IntelliJ doesn’t complain about the duplicated content roots, but I’m glad it works!#2020-02-1902:23cflemingThe not selecting dev thing is weird though, I’ll take a look and see if I can see anything going on there.#2020-02-1319:10tanzoniteblackI thought I had fixed this at one point by explicitly adding the test directories in the :extra-paths of the :dev alias for my top deps.edn, but that doesn't seem to be working anymore#2020-02-1401:18d-t-wAnyone else having issues with auto-import in the REPL since upgrading to latest? (https://github.com/cursive-ide/cursive/issues/2254)#2020-02-1408:36Ivar RefsdalYes. I've had that problem before as well ...#2020-02-1408:53Ivar RefsdalAnd I also have this problem after upgrading to 2019.3.3#2020-02-1409:56imrehave you tried 'invalidate caches and restart'?#2020-02-1410:00Ivar RefsdalThanks for the tip @U08BJGV6E. Unfortunately the same error and stacktrace appears (posted in the github-issue)#2020-02-1410:01imrelet me see if I can repro#2020-02-1410:01imreyep#2020-02-1410:02Ivar RefsdalI can only repro on new projects. Old projects work fine (at least most do)#2020-02-1410:02imreinteresting#2020-02-1623:20cflemingThanks for the reproduction case @UGJE0MM0W, I’ll try to reproduce that today.#2020-02-1703:22cflemingOk, the stacktrace is fixed in the next EAP. I think that’s unrelated to the auto-import issue, which I’ve moved to another issue as per the issue comment.#2020-02-1411:18gravThe “Use port from nREPL file” option in remote repl configs seems to be broken in latest EAP versions (tried a 1.9.0 EAP and a the most recent 1.9.1 EAP). If I select a module, click Ok, and then go back to the config, the module selection is gone again (and there’s a “Run Configuration Error: Please select a valid module” error in the bottom of the dialog).#2020-02-1623:21cflemingThanks, I’ll check that.#2020-02-1703:40cflemingThis was a problem when the selected module wasn’t a lein module - I’ve fixed that for the next EAP.#2020-02-1411:20gravhttp://g.recordit.co/SoVwwQHmew.gif#2020-02-1411:21gravIDEA 2019.2.4#2020-02-1415:06ikitommi#2020-02-1415:06ikitommiUpdated to latest Cursive and it… stopped working.#2020-02-1415:07ikitommi2019.2.3#2020-02-1415:26ikitommiupdate idea to 2019.3.3 and it’s working again.#2020-02-1623:21cflemingYes, unfortunately there’s a bad bug affecting only 2019.2, I should have a fix out today.#2020-02-1416:25IsaacHello! Is anyone else unable to switch their lein version due to a greyed out Apply button?
https://github.com/cursive-ide/cursive/issues/2307#2020-02-1623:22cflemingSorry about this, I’ll try to get to this today.#2020-02-1420:00Joe R. SmithIs it possible to toggle between aligned and not-aligned values in lets and maps with a keymapping?#2020-02-1623:23cflemingNo, this isn’t possible unfortunately. The issue is that the next time you reformat it will go back to whatever you have configured.#2020-02-1420:01Joe R. Smithabout 70% I want things aligned .. then there are the times I don't#2020-02-1515:04Ivan KozHow to connect\run shadow-cljs, watcher cljs repl from cursive? Can it be simplified?#2020-02-1515:23Ivan KozCurrently there is two Idea tasks; first runs lein -> shadow-cljs watch, and second connects to server's nrepl.
The tedious part is to run second task and call (shadow.cljs.devtools.api/repl :app) to access cljs repl.#2020-02-1623:24cflemingI see thheller replied over at #shadow-cljs, but I am planning some init-forms for REPL configs that will be automatically sent once the REPL connects.#2020-02-1516:03Ivan Koz@cfleming can you make it so repl wouldn't NPE if server is offline, but rather retry on a timeout?
Error connecting to localhost:8000 - class .ConnectException: Connection refused (Connection refused)
Exception starting REPL: java.lang.NullPointerException
#2020-02-1623:24cflemingThe NPE is definitely a bug, I’ll fix that. The retrying is trickier, I’ll think about that.#2020-02-1516:59joshkhdoes cursive support shadow-cljs projects where there's no project.clj or a deps.edn? Edit* i can't seem to import a project without either Deps or Lein scaffolding, and i'd like to avoid duplicating my shadow-cljs.edn dependencies in a deps.edn file 🙂#2020-02-1517:28dpsuttoni think the shadow documentation mentions using shadow to create a pom file#2020-02-1517:28dpsuttonhttps://shadow-cljs.github.io/docs/UsersGuide.html#_cursive#2020-02-1614:41joshkhcheers @dpsutton 🙂#2020-02-1623:25cflemingYes, Thomas (shadow dev) uses Cursive and that’s his recommendation until I get native shadow support done.#2020-02-1621:11Janne SauvalaDo you also see Cursive being a little too chatty when using it with REBL? Is there a way to surpass these messages? https://github.com/cursive-ide/cursive/issues/2113#issuecomment-578838307#2020-02-1700:05cflemingAre you using nREPL to connect to REPL?#2020-02-1705:33Janne SauvalaYes. I’m also using nrebl.middleware (https://github.com/RickMoynihan/nrebl.middleware) to capture the data in REBL#2020-02-1621:20kulminaatorhow do you fire up deps.edn style project's repl in cursive ?#2020-02-1623:27cflemingThere’s a quickstart here: https://cursive-ide.com/userguide/first-repl.html#importing-an-existing-project, which includes starting a REPL, or there are full details for deps here: https://cursive-ide.com/userguide/deps.html#2020-02-1710:07imreThere is no bindable action currently to trigger stub generation when the popup appears, is there?#2020-02-1720:58cflemingNo, there isn’t, but that would be nice. I’ll think about that, because it would also be good to have an action to trigger the stub check. Currently you have to refresh your lein/deps project to do that.#2020-02-1813:39onetom@U08BJGV6E i usually just do cmd-shift-a then ref deps
i cloud just probably assign some abbreviation to it.
i've noticed in recent versions there are spacemacs-style (or cider-style) abbreviations are introduced for the various test operations too. very good idea! it helps bridging the worlds of ppl using different editors 🙂#2020-02-1813:40imrecheers. I am aware about ref deps, have it bound. My question was specificly about stub generation though, so I don't have to hover and click when the notification appears#2020-02-1813:43onetomah, misread it, sorry... im getting tired, i guess#2020-02-1802:56onetomI'm missing newly added dependencies from my repl, even after i do a Refresh Clojure Deps Projects and restart the REPL.
There is a suspicious thing going on though, because the classpath i see folded in the repl window, mentions the idea_rt.jar multiple times, just with different values:
Starting nREPL server...
/nix/store/8p4ny5xj4p6363kak2h2nh3xnzk6d09p-zulu1.8.0_121-8.20.0.5/bin/java -Dclojure.libfile=/private/var/folders/dm/bjgtcwgx7nqfh3flbpq7m0qc0000gn/T/libfile4.libs "-javaagent:/Users/onetom/JetBrains/apps/IDEA-U/ch-0/201.5259.13/IntelliJ IDEA 2020.1 IDEA 2020.1 " "-javaagent:/Users/onetom/JetBrains/apps/IDEA-U/ch-0/201.5259.13/IntelliJ IDEA 2020.1 IDEA 2020.1 " "-javaagent:/Users/onetom/JetBrains/apps/IDEA-U/ch-0/201.5259.13/IntelliJ IDEA 2020.1 IDEA 2020.1 " -Dfile.encoding=UTF-8 -classpath "/Users/onetom/JetBrains/apps/IDEA-U/ch-0/201.5259.13/IntelliJ IDEA 2020.1 EAP.app.plugins/clojure-plugin/lib/nrepl-0.6.0.jar:test:src:rsc:/Users/onetom/.m2/repository/com/cognitect/transit-java/0.8.337/transit-java-0.8.337.jar:/Users/onetom/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.62/bcprov-jdk15on-1.62.jar:/Users/onetom/.m2/repository/buddy/buddy-core/1.6.0/buddy-core-1.6.0.jar:/Users/onetom/.m2/repository/org/clojure/data.json/0.2.7/data.json-0.2.7.jar:/Users/onetom/
My run config is:
• Local nREPL
• Run with Deps
° Aliases: expect,test
• Shorten command line: user-local default: none
After restarting IntelliJ, the problem went away.
Today it cropped up again, but it might be my fault this time, because I'm getting the same error from the command-line too:
clj -Aexpect:test -e "(require 'gini.system)"
I'm on Cursive 1.9.1-eap4-2020.1, IntelliJ Build #IU-201.5259.13, built on February 13, 2020#2020-02-1803:13onetomOk, I fixed my fault, but the issue persisted.
After restarting IntelliJ, the problem went away and I could require the newly added dependency.#2020-02-1803:48cflemingThat’s very weird - let me know if it recurs.#2020-02-1804:56onetomit has just happened again.
i can not even cmd-shift-l a source file from my own code.
i've just restarted my REPL session with cmd-r and this is all the classpath i get:
Starting nREPL server...
/nix/store/8p4ny5xj4p6363kak2h2nh3xnzk6d09p-zulu1.8.0_121-8.20.0.5/bin/java -Dclojure.libfile=/private/var/folders/dm/bjgtcwgx7nqfh3flbpq7m0qc0000gn/T/libfile621.libs "-javaagent:/Users/onetom/JetBrains/apps/IDEA-U/ch-0/201.5259.13/IntelliJ IDEA 2020.1 IDEA 2020.1 " "-javaagent:/Users/onetom/JetBrains/apps/IDEA-U/ch-0/201.5259.13/IntelliJ IDEA 2020.1 IDEA 2020.1 " -Dfile.encoding=UTF-8 -classpath /private/var/folders/dm/bjgtcwgx7nqfh3flbpq7m0qc0000gn/T/classpath1820877154.jar clojure.main -i /private/var/folders/dm/bjgtcwgx7nqfh3flbpq7m0qc0000gn/T/form-init1045387347113886493.clj
objc[50359]: Class JavaLaunchHelper is implemented in both /nix/store/8p4ny5xj4p6363kak2h2nh3xnzk6d09p-zulu1.8.0_121-8.20.0.5/bin/java (0x109ed84c0) and /nix/store/8p4ny5xj4p6363kak2h2nh3xnzk6d09p-zulu1.8.0_121-8.20.0.5/jre/lib/libinstrument.dylib (0x109f774e0). One of the two will be used. Which one is undefined.
Connecting to local nREPL server...
nREPL server started on port 61856 on host localhost -
Clojure 1.10.1
(there is that java error, but that's there for a long time and haven't caused any issues so far)#2020-02-1805:01onetomah, ive changed to that jar manifest option in the repl command line shortening option, that's why it's so short.
i've checked the file and it contains my src dir, so that's not the problem:
$ unzip -c -l /private/var/folders/dm/bjgtcwgx7nqfh3flbpq7m0qc0000gn/T/classpath1780313107.jar META-INF/MANIFEST.MF | rg src
.jar file:/test file:/src file:/rsc file:/Users/onetom/.m2/repository/c
3cd336851b9/src/ file:/Users/onetom/.m2/repository/com/google/guava/gua
#2020-02-1805:02onetomi've restarted my nrepl session and when i tried to load a namespace, it was complaining that its dependent namespaces couldn't be found.
however, if i load them manually in dependency order, the cmd-shift-l operations succeed:
nREPL server started on port 62569 on host localhost -
Clojure 1.10.1
Loading src/gini/system.clj...
Syntax error (FileNotFoundException) compiling at (src/gini/system.clj:1:1).
Could not locate gini/datomic__init.class, gini/datomic.clj or gini/datomic.cljc on classpath.
Loading src/gini/datomic.clj...
Syntax error (FileNotFoundException) compiling at (src/gini/datomic.clj:1:1).
Could not locate gini/model__init.class, gini/model.clj or gini/model.cljc on classpath.
Loading src/gini/model.cljc... done
Loading src/gini/datomic.clj... done
Loading src/gini/system.clj... done
#2020-02-1805:04onetomwhat i suspect the problem might be is that model.cljc file.
i've seen weired resolution issues, when i was mixing cljc files into my project...#2020-02-1805:06onetomokay, the problem has survived an intellij restart too, so it seems reproducible#2020-02-1805:09onetomif i've commented out the dependency on the cljc file, then i could load my namespace, which was indirectly depend on it#2020-02-1805:15onetomseems like the issue might be related to
[hodur-engine.core :as hodur]
which is also a cljc namespace#2020-02-1805:17onetomwhen i try to navigate to the source of the hodur-engine.core ns with cmd-b, i see 2 entries for it, which are seemingly the same#2020-02-1805:29onetomi've tried to isolate the problem in a minimal project, but it does not occur there, so it's not as trivial as i hoped.
i've also upgraded hodur-engine from 0.1.6 to 0.1.7 but that didn't change the situation either#2020-02-1813:33onetomissue persists with cursive 1.9.1-eap5-2020.1 and 1.9.1-eap5-2019.3
downgrading to eap3 now#2020-02-1813:44onetomi cant even start the server, even in clojure.main mode or without any special aliases. im just consistently getting this error:
Error running 'XXX REPL': Deferred parameters have not been cached!
#2020-02-1813:57onetom1.9.1-eap3-2019.3 (on IntelliJ 2019.3.2 though) works in both nREPL and clojure.main modes.#2020-02-1814:23imreI found in EAP 5 that my repl actions don't become available in 'find action...' until I open and close the edit repl actions dialog#2020-02-2110:32cflemingThis is fixed in eap-8, out now.#2020-02-2110:35imrecheers Colin, just saw it came out#2020-02-1815:16rafaelJust updated to 1.9.1-eap5-2020.1 (I'm running IDEA 2020.1 EAP), and editing is almost completely broken. Editor stops accepting keyboard input from time to time, and there is a file it just refuses to open. I think the problems correlate to exceptions being logged to the console. Is anyone else seeing the same issue? Should I open a github issue with the exceptions? I'll try to downgrade and see if the problem goes away.#2020-02-1821:58cfleming@U5FEGMC4D I’d definitely be interested in seeing those exceptions, either here or in an issue - I can’t reproduce that.#2020-02-1821:58cflemingIf you’ve downgraded they should hopefully still be in your log file.#2020-02-1913:43rafaelSorry, had to hunt around for the logs for a while. There are lots of exceptions like:
#2020-02-1913:43rafael2020-02-18 12:04:01,248 [1757753] ERROR - n.impl.GeneralHighlightingPass - In file: file:///home/rafael/dev/nu/stem/stem-framework/src/stem/kafka/producing.clj
java.lang.IllegalArgumentException: Argument for @NotNull parameter 'message' of com/intellij/codeInsight/daemon/impl/AnnotationHolderImpl.newAnnotation must not be null
at com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl.$$$reportNull$$$0(AnnotationHolderImpl.java)
at com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl.newAnnotation(AnnotationHolderImpl.java)
at cursive.editor.braceHighlighter.ClojureBraceHighlighter.annotate(ClojureBraceHighlighter.java:59)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:129)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:110)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.runVisitors(GeneralHighlightingPass.java:349)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$collectHighlights$5(GeneralHighlightingPass.java:283)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:309)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.lambda$analyzeByVisitors$6(GeneralHighlightingPass.java:312)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:93)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:312)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:280)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:225)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:83)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:52)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:429)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:971)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:422)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:577)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:523)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:421)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:397)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:158)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:156)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:395)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:171)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
2020-02-18 12:04:01,248 [1757753] ERROR - n.impl.GeneralHighlightingPass - IntelliJ IDEA 2020.1 EAP Build #IU-201.3803.71
2020-02-18 12:04:01,249 [1757754] ERROR - n.impl.GeneralHighlightingPass - JDK: 11.0.2; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2020-02-18 12:04:01,249 [1757754] ERROR - n.impl.GeneralHighlightingPass - OS: Linux
2020-02-18 12:04:01,249 [1757754] ERROR - n.impl.GeneralHighlightingPass - Plugin to blame: Cursive version: 1.9.1-eap5-2020.1
2020-02-18 12:04:01,249 [1757754] ERROR - n.impl.GeneralHighlightingPass - Last Action: EditorPaste
2020-02-18 12:04:01,252 [1757757] ERROR - n.impl.GeneralHighlightingPass - In file: file:///home/rafael/dev/nu/stem/stem-framework/test/stem/integration_test.clj
#2020-02-1913:46rafaelThen lots of:
#2020-02-1913:46rafael2020-02-18 12:08:32,670 [ 58896] ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 2020.1 EAP Build #IU-201.3803.71
2020-02-18 12:08:32,670 [ 58896] ERROR - llij.ide.plugins.PluginManager - JDK: 11.0.2; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2020-02-18 12:08:32,670 [ 58896] ERROR - llij.ide.plugins.PluginManager - OS: Linux
2020-02-18 12:08:32,670 [ 58896] ERROR - llij.ide.plugins.PluginManager - Plugin to blame: Cursive version: 1.9.1-eap5-2020.1
2020-02-18 12:08:32,671 [ 58897] ERROR - llij.ide.plugins.PluginManager - Last Action: Tree-selectNext
2020-02-18 12:08:33,130 [ 59356] ERROR - mpl.search.PsiSearchHelperImpl - Error during processing of: integration_test.clj
java.lang.NoSuchMethodError: com.intellij.AbstractBundle.message(Ljava/util/ResourceBundle;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
at cursive.ClojureBundle.message(ClojureBundle.java:26)
at cursive.parser.ClojureParser.parseExpressions(ClojureParser.java:141)
at cursive.parser.ClojureParser.parseList(ClojureParser.java:405)
at cursive.parser.ClojureParser.parseExpression(ClojureParser.java:67)
at cursive.parser.ClojureParser.parseExpressions(ClojureParser.java:136)
at cursive.parser.ClojureParser.parseList(ClojureParser.java:405)
at cursive.parser.ClojureParser.parseExpression(ClojureParser.java:67)
at cursive.parser.ClojureParser.parseExpressions(ClojureParser.java:136)
at cursive.parser.ClojureParser.parseList(ClojureParser.java:405)
at cursive.parser.ClojureParser.parseExpression(ClojureParser.java:67)
at cursive.parser.ClojureParser.parseExpressions(ClojureParser.java:136)
at cursive.parser.ClojureParser.parseList(ClojureParser.java:405)
at cursive.parser.ClojureParser.parseExpression(ClojureParser.java:67)
at cursive.parser.ClojureParser.parseExpressions(ClojureParser.java:136)
at cursive.parser.ClojureParser.parseList(ClojureParser.java:405)
at cursive.parser.ClojureParser.parseExpression(ClojureParser.java:67)
at cursive.parser.ClojureParser.parseExpressions(ClojureParser.java:136)
at cursive.parser.ClojureParser.parseList(ClojureParser.java:405)
at cursive.parser.ClojureParser.parseExpression(ClojureParser.java:67)
at cursive.parser.ClojureParser.parseExpressions(ClojureParser.java:136)
at cursive.parser.ClojureParser.parseList(ClojureParser.java:405)
at cursive.parser.ClojureParser.parseExpression(ClojureParser.java:67)
at cursive.parser.ClojureParser.parse(ClojureParser.java:58)
at com.intellij.psi.tree.ILazyParseableElementType.doParseContents(ILazyParseableElementType.java:75)
at com.intellij.psi.tree.IFileElementType.parseContents(IFileElementType.java:53)
at com.intellij.psi.impl.source.tree.LazyParseableElement.lambda$ensureParsed$0(LazyParseableElement.java:189)
at com.intellij.psi.impl.DebugUtil.performPsiModification(DebugUtil.java:565)
at com.intellij.psi.impl.source.tree.LazyParseableElement.ensureParsed(LazyParseableElement.java:188)
at com.intellij.psi.impl.source.tree.LazyParseableElement.getFirstChildNode(LazyParseableElement.java:237)
at com.intellij.psi.impl.source.tree.CompositeElement.findLeafElementAt(CompositeElement.java:139)
at com.intellij.psi.impl.source.tree.CompositeElement.findLeafElementAt(CompositeElement.java:46)
at com.intellij.psi.impl.search.LowLevelSearchUtil.findNextLeafElementAt(LowLevelSearchUtil.java:122)
at com.intellij.psi.impl.search.LowLevelSearchUtil.processOffsets(LowLevelSearchUtil.java:196)
at com.intellij.psi.impl.search.LowLevelSearchUtil.processElementsAtOffsets(LowLevelSearchUtil.java:178)
at com.intellij.psi.impl.search.PsiSearchHelperImpl$4.execute(PsiSearchHelperImpl.java:841)
at com.intellij.psi.impl.search.PsiSearchHelperImpl$2.processInReadAction(PsiSearchHelperImpl.java:240)
at com.intellij.psi.impl.search.PsiSearchHelperImpl$2.processInReadAction(PsiSearchHelperImpl.java:231)
at com.intellij.openapi.application.ReadActionProcessor.lambda$process$0(ReadActionProcessor.java:28)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:795)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:61)
at com.intellij.openapi.application.ReadActionProcessor.process(ReadActionProcessor.java:28)
at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processCandidates$14(PsiSearchHelperImpl.java:801)
at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processVirtualFile$6(PsiSearchHelperImpl.java:454)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:966)
at com.intellij.openapi.application.ex.ApplicationUtil.tryRunReadAction(ApplicationUtil.java:25)
at com.intellij.psi.impl.search.PsiSearchHelperImpl.processVirtualFile(PsiSearchHelperImpl.java:438)
at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processPsiFileRoots$2(PsiSearchHelperImpl.java:314)
at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$null$3(PsiSearchHelperImpl.java:387)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:158)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:156)
at com.intellij.psi.impl.search.PsiSearchHelperImpl.lambda$processFilesConcurrentlyDespiteWriteActions$4(PsiSearchHelperImpl.java:386)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:149)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:162)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:971)
at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:577)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:523)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:117)
at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:158)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:156)
at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
2020-02-18 12:08:33,131 [ 59357] ERROR - mpl.search.PsiSearchHelperImpl - IntelliJ IDEA 2020.1 EAP Build #IU-201.3803.71
2020-02-18 12:08:33,131 [ 59357] ERROR - mpl.search.PsiSearchHelperImpl - JDK: 11.0.2; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2020-02-18 12:08:33,131 [ 59357] ERROR - mpl.search.PsiSearchHelperImpl - OS: Linux
2020-02-18 12:08:33,132 [ 59358] ERROR - mpl.search.PsiSearchHelperImpl - Plugin to blame: Cursive version: 1.9.1-eap5-2020.1
2020-02-18 12:08:33,132 [ 59358] ERROR - mpl.search.PsiSearchHelperImpl - Last Action: Tree-selectNext
#2020-02-1913:48rafaelI'm not sure right now, but I believe this latter one was when I tried to open the file in question and it wouldn't even open (after I downgraded and opened the file, I noticed it had unbalanced parentheses - I'm using paredit - but I failed to capture the contents at the time, sorry)#2020-02-1913:50rafaelUpgraded again to 1.9.1-eap6-2020.1 and editing seems broken in the same way.#2020-02-1913:52rafaelEvery key press generates the following exception:#2020-02-1913:52rafael2020-02-19 10:51:36,126 [ 821275] ERROR - aemon.impl.PassExecutorService - Abandoned AnnotationBuilder - its 'create()' method was never called: Builder{message='null', myCurrentElement=PsiElement((), severity=INFORMATION, range=(0,1), enforcedAttributes=[java.awt.Color[r=170,g=170,b=170],null,0,BOXED,null,{},null]}
java.lang.IllegalStateException: Abandoned AnnotationBuilder - its 'create()' method was never called: Builder{message='null', myCurrentElement=PsiElement((), severity=INFORMATION, range=(0,1), enforcedAttributes=[java.awt.Color[r=170,g=170,b=170],null,0,BOXED,null,{},null]}
at com.intellij.codeInsight.daemon.impl.B.assertAnnotationCreated(B.java:325)
at com.intellij.codeInsight.daemon.impl.AnnotationHolderImpl.assertAllAnnotationsCreated(AnnotationHolderImpl.java:219)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.analyze(DefaultHighlightVisitor.java:98)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.analyzeByVisitors(GeneralHighlightingPass.java:312)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectHighlights(GeneralHighlightingPass.java:280)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.collectInformationWithProgress(GeneralHighlightingPass.java:225)
at com.intellij.codeInsight.daemon.impl.ProgressableTextEditorHighlightingPass.doCollectInformation(ProgressableTextEditorHighlightingPass.java:83)
at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:52)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:429)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:971)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:422)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:577)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:523)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:421)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:397)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:158)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:156)
at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:395)
at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:171)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
2020-02-19 10:51:36,127 [ 821276] ERROR - aemon.impl.PassExecutorService - IntelliJ IDEA 2020.1 EAP Build #IU-201.3803.71
2020-02-19 10:51:36,127 [ 821276] ERROR - aemon.impl.PassExecutorService - JDK: 11.0.2; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o
2020-02-19 10:51:36,127 [ 821276] ERROR - aemon.impl.PassExecutorService - OS: Linux
2020-02-19 10:51:36,127 [ 821276] ERROR - aemon.impl.PassExecutorService - Last Action: EditorUp #2020-02-1913:57rafaelMost key presses do work, but I can consistently reproduce one case where the input is ignored.#2020-02-1913:57rafaelIf I input, anywhere in a file, the character # then it doesn't accept further input.#2020-02-1914:02rafaelUploaded here (https://pastebin.com/DwjLr9v0) the logs for one editing session where I reproduced the problem with # on a new file (containing just a bare namespace declaration)#2020-02-1920:16rafaelAfter working for several hours with 1.9.1-eap4, idea completely froze while editing, but it looks like it's a different bug. The logs point to a StackOverflowException: https://pastebin.com/N7TsQG0i#2020-02-1920:17cflemingThanks, I’m going to investigate all that today. Just checking - do you have rainbow parens on?#2020-02-1920:22rafaelYeah, I have rainbow parens on#2020-02-1923:22cflemingOk, thanks for all that. I’ve fixed the rainbow parens issues, but I cannot reproduce or figure out the NoSuchMethodError one. I’ll keep digging.#2020-02-2017:01rafaelThat's great, thanks. I thought it could have something to do with the new JetBrains font with ligatures, but I turned off ligatures and the problem remained.#2020-02-2022:37cflemingSo you’re still seeing the issue with eap7?#2020-02-1815:21rafaelDowngrading to 1.9.1-eap4 appears to have fixed the issue.#2020-02-1816:09dmarjenburghIn 1.9.1-eap5-2019.3, I cannot close the REPL tab by pressing the tab. Trying to start a new REPL gives the following error:
17:09 Error running 'REPL': Receiver class cursive.repl.toolwindow$repl_listener$reify__11844 does not define or inherit an implementation of the resolved method 'abstract void contentAdded(com.intellij.ui.content.ContentManagerEvent)' of interface com.intellij.ui.content.ContentManagerListener.
#2020-02-1816:13dmarjenburghjava.lang.NullPointerException
at clojure.core$deref_future.invokeStatic(core.clj:2300)
at clojure.core$deref.invokeStatic(core.clj:2320)
at clojure.core$deref.invoke(core.clj:2306)
at cursive.inspections.symbol$fn__7554.invokeStatic(symbol.clj:161)
at cursive.inspections.symbol$fn__7554.invoke(symbol.clj:118)
at cursive.inspections.symbol$fn__7522$G__7517__7529.invoke(symbol.clj:107)
at cursive.inspections.symbol$deprecated_api.invokeStatic(symbol.clj:175)
at cursive.inspections.symbol$deprecated_api.invoke(symbol.clj:170)
at clojure.lang.Var.invoke(Var.java:393)
at cursive.api.DelayedFn.invoke(DelayedFn.java:41)
at cursive.inspections.ClInspectionVisitor.visitElement(ClInspectionVisitor.java:29)
at com.intellij.psi.impl.PsiElementBase.accept(PsiElementBase.java:274)
at com.intellij.codeInspection.InspectionEngine.acceptElements(InspectionEngine.java:77)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$null$6(LocalInspectionsPass.java:332)
at com.intellij.util.AstLoadingFilter.lambda$toComputable$2(AstLoadingFilter.java:167)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:125)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:114)
at com.intellij.util.AstLoadingFilter.disallowTreeLoading(AstLoadingFilter.java:109)
at com.intellij.codeInsight.daemon.impl.LocalInspectionsPass.lambda$visitRestElementsAndCleanup$7(LocalInspectionsPass.java:331)
at com.intellij.concurrency.ApplierCompleter.execAndForkSubTasks(ApplierCompleter.java:148)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:997)
at com.intellij.concurrency.ApplierCompleter.lambda$wrapInReadActionAndIndicator$1(ApplierCompleter.java:105)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.concurrency.ApplierCompleter.wrapInReadActionAndIndicator(ApplierCompleter.java:116)
at com.intellij.concurrency.ApplierCompleter.lambda$compute$0(ApplierCompleter.java:96)
at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:167)
at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:157)
at com.intellij.concurrency.ApplierCompleter.compute(ApplierCompleter.java:96)
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
#2020-02-1822:04cflemingThanks, I’ve fixed the NPE, and I’m looking at the abstract method problem.#2020-02-1902:32steveb8nI have the same abstract error with my shadow CLJS repl config. I’ll downgrade to unblock#2020-02-1903:10cflemingI can’t reproduce the abstract method error, nor do I have a plausible explanation for how it could happen. Does anyone have a stacktrace for that in their logs?#2020-02-1914:19dmarjenburghSometimes I don’t get the stacktrace, but just a red box in the corner. Here a some minimal steps of what I do and what happens:
1. Create a new empty deps project. Everytime it is opened, the following errors happens:
Cannot create listener
com.intellij.diagnostic.PluginException: Cannot create listener cursive.notifications.LeiningenProjectNotificationProvider$Listener [Plugin: com.cursiveclojure.cursive]
at com.intellij.serviceContainer.PlatformComponentManagerImpl.createListener(PlatformComponentManagerImpl.kt:559)
at com.intellij.util.messages.impl.MessageBusImpl.subscribeLazyListeners(MessageBusImpl.java:212)
at com.intellij.util.messages.impl.MessageBusImpl.syncPublisher(MessageBusImpl.java:193)
at cursive.build.BuildSystemProjectsManager$onChange$1.run(BuildSystemManager.kt:101)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:324)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:314)
at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:264)
at com.intellij.util.ui.EdtInvocationManager.invokeAndWaitIfNeeded(EdtInvocationManager.java:57)
at com.intellij.util.ui.UIUtil.invokeAndWaitIfNeeded(UIUtil.java:2438)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:275)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:233)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:231)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:371)
at com.intellij.util.Alarm$Request.run(Alarm.java:358)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:217)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:441)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:781)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: cursive.notifications.LeiningenProjectNotificationProvider$Listener PluginClassLoader[com.cursiveclojure.cursive, 1.9.1-eap5-2019.3]
#2020-02-1914:23dmarjenburgh2. Create a REPL run config (nREPL + run with deps). Start it and then close it by pressing the cross (Close REPL tab). The REPL shuts down, but the tab doesn’t close and the following error happens:
#2020-02-1914:23dmarjenburghjava.lang.AbstractMethodError: Receiver class cursive.repl.toolwindow$repl_listener$reify__11844 does not define or inherit an implementation of the resolved method 'abstract void selectionChanged(com.intellij.ui.content.ContentManagerEvent)' of interface com.intellij.ui.content.ContentManagerListener.
at jdk.internal.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.intellij.util.EventDispatcher.dispatchVoidMethod(EventDispatcher.java:130)
at com.intellij.util.EventDispatcher.access$000(EventDispatcher.java:24)
at com.intellij.util.EventDispatcher$1.invoke(EventDispatcher.java:88)
at com.sun.proxy.$Proxy117.selectionChanged(Unknown Source)
at com.intellij.ui.content.impl.ContentManagerImpl.fireSelectionChanged(ContentManagerImpl.java:556)
at com.intellij.ui.content.impl.ContentManagerImpl.removeFromSelection(ContentManagerImpl.java:391)
at com.intellij.ui.content.impl.ContentManagerImpl.doRemoveContent(ContentManagerImpl.java:208)
at com.intellij.ui.content.impl.ContentManagerImpl.removeContent(ContentManagerImpl.java:171)
at com.intellij.ui.content.impl.ContentManagerImpl.removeContent(ContentManagerImpl.java:164)
at cursive.repl.toolwindow$close_action$fn__11908.invoke(toolwindow.clj:341)
at cursive.actions$dumb_aware$fn__167.invoke(actions.clj:88)
at cursive.actions.proxy$com.intellij.openapi.project.DumbAwareAction$ClojureAction$WithShortcutSet$d4627f96.actionPerformed(Unknown Source)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:298)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:315)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:289)
at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:194)
at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:157)
at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:447)
at java.desktop/java.awt.Component.processEvent(Component.java:6416)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:846)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:778)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
#2020-02-1914:24dmarjenburgh3. Subsequent clicks to close the REPL tab do nothing. Trying to restart the REPL shows an error:#2020-02-1919:56tony.kayhaving the same problem when I try to start a second REPL. First one starts fine.#2020-02-1919:57tony.kay#2020-02-1919:58tony.kayno stack trace in logs…in fact, no error in logs#2020-02-2112:40dmarjenburgh@cfleming The issue appears to have been solved in 1.9.1-eap8-2019.3. I don’t receive any errors anymore 😃#2020-02-2121:28cflemingHooray! Thanks for letting me know.#2020-02-2112:40dmarjenburgh@cfleming The issue appears to have been solved in 1.9.1-eap8-2019.3. I don’t receive any errors anymore 😃#2020-02-1904:45fbgavaHi guys, I just installed IntelliJ/Cursive on Windows (latest version), and when trying to "use tools.deps directly", the version is <none>, and after clicking on "Refresh" I'm finding this file inside .m2/repository/org/clojure/tools.deps/alpha, "resolver-status.properties", with the following content:
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
#Wed Feb 19 01:27:46 BRT 2020
maven-metadata-central.xml/@default-central-http\:<//repo1.maven.org/maven2/.lastUpdated=1582086466312>
maven-metadata-central.xml.error=Could not transfer metadata org.clojure\:tools.deps.alpha/maven-metadata.xml from/to central (http\:<//repo1.maven.org/maven2/>)\: status code\: 501, reason phrase\: HTTPS Required (501)
Anyone has any ideas on how to fix this? Tried manually adding a profile with https repository in settings.xml without luck. 😞#2020-02-1904:46cflemingHi @U7JCZJR0W, this is a bug which is fixed in the latest EAP build but not in stable releases yet. Oops, I see you just found the solution 🙂#2020-02-1904:47fbgavayup, i just saw the thread you replied above. thanks!#2020-02-1904:46fbgavanvm, just found a thread above with workaround and its fixed on EAP.#2020-02-1905:14emccue#2020-02-1905:14emccueinteresting bug maybe#2020-02-1905:15emccueI disabled the "unknown symbol highlight in orange" setting#2020-02-1905:24emccue(i don't actually want it gone, but i want to figure out a visual indicator that doesn't murder my eyes when im using a library that cursive can't resolve any symbols in)#2020-02-1922:27cflemingJust checking, do you know about customising symbol resolution? https://cursive-ide.com/userguide/macros.html. I know it doesn’t always work, but it might help if you’re not aware of it.#2020-02-1907:40thumbnailIs it possible to render a link (to a project-file) in the cursive terminal, just like the links in stacktrace?#2020-02-1922:30cflemingNot that I’m aware of, but I don’t actually use the terminal much. There may be something that IntelliJ does which allows that.#2020-02-2019:08thumbnailI meant the repl, sorry for the confusion 😅
there's a plug-in for the terminal, haven't tried it yer#2020-02-1908:14katoxI downgraded Cursive to eap4 and most REPL related problems went away. It seems that some UI glue is not quite right in the latest version.#2020-02-1908:45cfleming@U0KD0N5T5 Which REPL related problems were you seeing in the new version?#2020-02-1909:08katoxhttps://github.com/cursive-ide/cursive/issues/2315#2020-07-1022:10imreTo perhaps be able to properly use macros like this#2020-07-1117:01dvingoIf I alter-meta! on a var to change it's docstring will cursive pick this change when showing the documentation help? - same question for clojurescript - it looks like it's not working in cljs#2020-07-1117:43dpsuttoni see in clojure.core there are
(alter-meta! #'*agent* assoc :added "1.0")
(alter-meta! #'in-ns assoc :added "1.0")
(alter-meta! #'load-file assoc :added "1.0")
none of these seem to have documentation in cursive#2020-07-1117:44dvingogotcha - thanks!#2020-07-1117:45dpsutton(alter-meta! (find-ns 'clojure.core) assoc :doc "Fundamental library of the Clojure language")
in clj, (doc clojure.core) returns that. in cursive, control-j on clojure.core says "The core Clojure language"#2020-07-1117:45dpsuttonwhich comes from the def form
(ns ^{:doc "The core Clojure language."
:author "Rich Hickey"}
clojure.core)
interesting that is overridden with such similar language. and not done in-line#2020-07-1118:00dvingoha, that's interesting#2020-07-1123:25cflemingCursive won’t pick this up when getting doc in the editor (which comes via static analysis) but in the REPL it will.#2020-07-1203:37Vincent CantinIs it possible to have the size of the REPL view match the real size on the screen (i.e. without a scroll bar)?
That’s to have the display of Clojure data been printed without me having to scroll the view toward the right side each time I am evaluating a new expression.#2020-07-1203:39Vincent Cantin#2020-07-1300:49cflemingUnfortunately that’s actually surprisingly tricky. It’s also sort of transient, since it depends on the size of your REPL at any particular time (i.e. if you later resize your REPL previously printed forms will be wrong. Currently this just uses the standard editor right margin width.#2020-07-1300:49cflemingI can investigate making that dynamic based on the size of the window, could you file an issue for that?#2020-07-1308:19Vincent CantinCursive marks some symbol as "unresolved" while they should not be resolved, in a clojure.core/case expression (it's a macro).#2020-07-1308:21Vincent Cantinthe keys in a case expression are not evaluated#2020-07-1322:52cflemingYes, that’s true.#2020-07-1504:45Vincent CantinIt would be nice if the Clojure-specific constants like ##Inf would appear in the auto-completion list.#2020-07-1510:23tengstrandI haven't been able to evaluate expressions in Cursive for a while (when stopping at a break point). Is there a solution for that?#2020-07-1512:44katoxYou can set a break-point for one thread only instead of for all. But eval expression (alt-f8) should work even though there are some limitations.#2020-07-1601:20cfleming@U1G0HH87L What happens when you do?#2020-07-1609:42tengstrandI can evaluate "123" but not "(+ 1 2 3)" (or any other expression) @U0567Q30W.#2020-07-1623:00cfleming@U1G0HH87L That is https://github.com/cursive-ide/cursive/issues/2345, which should be fixed in Cursive 1.9.2.#2020-07-1706:16tengstrandIt works now, thanks!#2020-07-1518:35Michael CohenTrying to create a new Remote Clojure REPL configuration but seeing this error "No modules containing clojure.main found"....any ideas?#2020-07-1518:41salamyou can fix that by selecting a project/module from the “Project” drop-down list. #2020-07-1518:43Michael Cohenthe project dropdown list is....empty#2020-07-1518:43Michael Cohennot sure why, i have added a Leiningen module to the project#2020-07-1518:45salamit sounds like cursive was unable to recognize your project as a leiningen project. #2020-07-1518:45Michael Cohenhmm....i see these in the event log
11:43 AM Dependency resolution error
Error synchronising /Users/michaelcohen/xbeam/muncher/project.clj:
Failed to collect dependencies at lein-ancient:lein-ancient:jar:0.6.15
11:43 AM Dependency resolution error
Error synchronising muncher:0.1.0-SNAPSHOT:
Failed to collect dependencies at amazonica:amazonica:jar:0.3.152
#2020-07-1518:47salamyeah, that seems a like a problem that can cause this kind project/module related issues.#2020-07-1518:48salamdoes it work if you execute a lein command on the command line?#2020-07-1518:49Michael Cohenyeah, app runs fine otherwise, lein repl, etc...#2020-07-1518:53salamhmm… what does the Leiningen tool window look like?#2020-07-1518:59salamif you cannot find the leiningen tool window or it’s empty, you may have to re-import the project as a leiningen project: https://cursive-ide.com/userguide/leiningen.html#2020-07-1519:08Michael Cohen#2020-07-1519:09salamso your project was correctly recognized as of type leiningen... what happens if your hit the refresh button at the top?#2020-07-1519:10salami'm just curious to see if it'll cause the same maven errors...#2020-07-1519:11Michael Cohenit does appear to error. it pops open another message in the event log in the bottom right corner. which is strange, because....#2020-07-1519:11Michael Cohen#2020-07-1519:12Michael Cohen#2020-07-1519:14Michael Cohenfkin amazonica garbage#2020-07-1519:14salam😄#2020-07-1519:15salamyeah, we used it before but quickly switched to cognitect-labs aws-api and never looked back...#2020-07-1519:17salamone more thing to try is the good ol', ultimate weapon: "Invalidate Caches / Restart"#2020-07-1522:08chrisulloa+1 on moving away from amazonica#2020-07-1522:44Michael CohenFWIW, i had to remove the :local-repo key from project.clj and then Cursive picked everything up just fine#2020-07-1522:45salamah... sounds like a bug to me.#2020-07-1522:51Michael Cohenappreciate your time though 🙂#2020-07-1601:23cfleming@U015YDZ16AJ Just to make sure I understand, using :local-repo broke the Cursive project resolution, is that right? What did you have that set to?#2020-07-1606:11Michael Cohen@U0567Q30W yep, :local-repo was just set to a directory in the root of the project. all of the jars had already been downloaded there by maven. first i removed amazonica, which was the very first dep in this project, then tried to start a repl, got the same error that the next dep couldn't be resolved. removed that one, got the error again with the new, first dep in project.clj , finally just removed :local-repoand then it resolved everything...#2020-07-1606:42cflemingOk thanks, I’ll check that.#2020-07-1808:22mike_ananevI've got the same error today, in existing project, using deps.edn project. Any solutions?#2020-07-1808:27mike_ananev"Invalidate Caches / Restart" solved my problem.#2020-07-1621:35kennyHow does Cursive determine which "standard port file" to use if multiple exist? (e.g., .nrepl-port and .shadow-cljs/nrepl.port) Does it pick the newest one?#2020-07-1623:01cflemingIIRC it just tries them in order and uses the first one it finds. I could change it to pick the newest one pretty easily.#2020-07-1623:03kennyNewest seems like it'd make more sense. My guess is if you're relying on that behavior you should probably specify a custom port file haha.#2020-07-1701:15cflemingYeah, I think that’s probably true 🙂#2020-07-1719:30jCan Cursive auto run tests? Intellij products usually have an option under Run to auto test on file change#2020-07-1720:38salami don't think cursive can but you can try kaocha, a feature-rich test runner that has the --watch mode: https://github.com/lambdaisland/kaocha#2020-07-1721:35jthanks @UDCGPTV9R! I'll take a look#2020-07-2019:34GGfpcHello, I'm having a problem with Cursive and Leiningen. Whenever I import figwheel-main in my project.clj I get this error
#2020-07-2102:37cflemingThat looks like a problem in your project.clj, are you able to share it?#2020-07-2112:46GGfpcSure
(defproject goodstats "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Mozilla Public License 2.0"
:url "none"
:year 2020
:key "mpl-2.0"}
;; CLJ AND CLJS source code paths
:source-paths ["src/clj" "src/cljs"]
:dependencies [
]
:plugins [
[lein-cljfmt "0.6.8"]
[lein-cloverage "1.1.2"]
[lein-license "0.1.8"]
[lein-cljsbuild "1.1.8"]
]
:aliases {"fig" ["trampoline" "run" "-m" "figwheel.main"]
"fig:build" ["trampoline" "run" "-m" "figwheel.main" "-b" "dev" "-r"]
"fig:min" ["run" "-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]
"fig:test" ["run" "-m" "figwheel.main" "-co" "test.cljs.edn" "-m" "hello-world.test-runner"]}
:profiles {:dev {:dependencies [
[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.773"]
[clj-http "3.10.1"]
[org.clojure/data.xml "0.0.8"]
[com.bhauman/figwheel-main "0.2.3"]
[compojure "1.6.1"]
[domina "1.0.3"]
[com.bhauman/rebel-readline-cljs "0.1.4"]]
}}
)#2020-07-2019:34GGfpcjava.lang.RuntimeException: EOF while reading
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.EdnReader.read(EdnReader.java:130)
at clojure.lang.EdnReader$MetaReader.invoke(EdnReader.java:576)
at clojure.lang.EdnReader.read(EdnReader.java:145)
at clojure.lang.EdnReader.read(EdnReader.java:111)
at clojure.lang.EdnReader.readString(EdnReader.java:67)
at clojure.edn$read_string.invokeStatic(edn.clj:46)
at clojure.edn$read_string.invokeStatic(edn.clj:37)
at clojure.edn$read_string.invoke(edn.clj:37)
at cursive.leiningen.module$figwheel_main_outputs$fn__14374.invoke(module.clj:70)
at clojure.core$keep$fn__8559.invoke(core.clj:7341)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:58)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5402.invokeStatic(core.clj:137)
at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:24)
at clojure.core.protocols$fn__8146.invokeStatic(protocols.clj:75)
at clojure.core.protocols$fn__8146.invoke(protocols.clj:75)
at clojure.core.protocols$fn__8088$G__8083__8101.invoke(protocols.clj:13)
at clojure.core$reduce.invokeStatic(core.clj:6828)
at clojure.core$into.invokeStatic(core.clj:6895)
at clojure.core$into.invoke(core.clj:6887)
at cursive.leiningen.module$figwheel_main_outputs.invokeStatic(module.clj:74)
at cursive.leiningen.module$figwheel_main_outputs.invoke(module.clj:60)
at cursive.leiningen.module$with_source_paths.invokeStatic(module.clj:118)
at cursive.leiningen.module$with_source_paths.invoke(module.clj:79)
at cursive.leiningen.module$module.invokeStatic(module.clj:157)
at cursive.leiningen.module$module.invoke(module.clj:143)
at cursive.leiningen.module$module_info$fn__14434.invoke(module.clj:171)
at clojure.core$map$fn__5866.invoke(core.clj:2755)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5402.invokeStatic(core.clj:137)
at clojure.core$reduce1.invokeStatic(core.clj:930)
at clojure.core$set.invokeStatic(core.clj:4113)
at clojure.core$set.invoke(core.clj:4105)
at cursive.leiningen.module$module_info.invokeStatic(module.clj:171)
at cursive.leiningen.module$module_info.invoke(module.clj:159)
at cursive.leiningen.sync$sync.invokeStatic(sync.clj:136)
at cursive.leiningen.sync$sync.invoke(sync.clj:134)
at clojure.lang.Var.invoke(Var.java:393)
at cursive.api.DelayedFn.invoke(DelayedFn.java:41)
at cursive.build.BuildSystemProjectsManager$reimportAllProjects$$inlined$synchronized$lambda$1$1.invoke(BuildSystemManager.kt:154)
at cursive.build.BuildSystemProjectsManager$reimportAllProjects$$inlined$synchronized$lambda$1$1.invoke(BuildSystemManager.kt:35)
at cursive.application.ApplicationKt$sam$java_lang_Runnable$0.run(Application.kt)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:309)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:441)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:908)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:781)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:424)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:423)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
#2020-07-2019:34GGfpcRemoving the dependency fixes it. Is this a known issue?#2020-07-2114:19wegiHey there folks. Whenever I use Cursive with CLojurescript, a lot of the interop-functions are highlighted as not resolvable. .preventDefault or .indexOf for example. Any possibility to get them being resolved correctly, through type-hints or similar? Or at least an option to mute specific warnings, so the IDE doesn't look like a christmas tree. 🙂#2020-07-2211:12cflemingUgh, yes, this is a pain for a lot of people, sorry - I’m planning to fix this soon.#2020-07-2220:14wegiThanks, much appreciated.#2020-07-2115:23robHi Colin 👋 have you ever looked at making use of the “scientific tools” intellij ships to show data from a python console? Seems like the data explorer and plot tab could be driven by the datafy protocols a-la rebl. Where “could” mostly means “I’d like that”, not dug into how possible this is at all 🙂#2020-07-2211:13cflemingI think the short answer to this is “no” 🙂#2020-07-2211:13cflemingI don’t use the Python stuff at all and none of that bit is open source, so even if it made it to the top of my to-do list (very unlikely) I would’t know where to start.#2020-07-2213:10maxtI'm stuck at tools.deps version 0.8.599 When I press the Refresh button, nothing seems to change. I would like to use 0.8.709 which is the one the latest clojure cli tool uses#2020-07-2213:24maxtAlso, when I instead try to use CLI tools directly, I get this error
The following errors were found during project resolve:
/home/max/wavy/wavy-v2/deps.edn:
Coordinate type :mvn not loaded for library org.clojure/clojure in coordinate {:mvn/version "1.10.1"}#2020-07-2213:25Alex Miller (Clojure team)the coordinate types are ordinarily automatically loaded by requiring org.clojure.tools.deps.alpha so not sure what Cursive is doing where that's not happening#2020-07-2213:36maxtIt still happens if I make a new deps project from within cursive#2020-07-2213:41maxtAlso still happens after removing ~/.clojure and reinstalling clojure cli tools#2020-07-2213:44manutter51Maybe uninstall/reinstall the Cursive plugin?#2020-07-2213:44salami’m not 100% sure but i had similar, weird problems because of this issue: https://github.com/cursive-ide/cursive/issues/2105#2020-07-2213:49maxtThank you for the hints! I did have several versions in that directory but the problem persists after removing all but the latest.
But I also just found out that Cursive is no longer available for my version of IntelliJ, so I might just need to upgrade#2020-07-2214:30maxtAfter upgrading to IntelliJ CU 2020.1.4 and Cursive 1.9.2 the refresh button works and I can use tools.deps v 0.8.709.
But I still get the same maven resolution error when choosing the "Use CLI Tools" option#2020-07-2214:36maxtTo recap on the error:
• I open IntelliJ CU 2020.1.4 with Cursive 1.9.2
• I select "Use CLI Tools" in the Clojure Deps settings panel, which detects version 1.10.1.561
• I create a new Clojure Deps project in Cursive with File > New > Project
• I get this error in the console
16:31 Errors during project resolution
The following errors were found during project resolve:
/home/max/t/mvn-not-loaded-repro/deps.edn:
Coordinate type :mvn not loaded for library org.clojure/clojure in coordinate {:mvn/version "1.10.1"}
• The same project works if I start it with clj from the command line. clj -Stree also works.
#2020-07-2311:58cflemingHi @maxt, that is very strange. That error used to appear a long time ago, but no-one has reported it for ages. It looks like you’re on Linux, correct? Could you reproduce the problem and then send me a copy of your log file, in case there’s anything to see there? Probably best to email it to <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection>.#2020-07-2312:00cflemingBTW you can find the log using Help | Show log in <whatever>#2020-07-2215:12onetom@maxt see my answer in #datomic#2020-07-2220:45markbastianHey all, I am trying to get a new dev onboarded with cursive on windows in a tools.deps project. When we try to get a REPL to run the dialog says "No modules containing clojure.main" found. Any suggestions? He used the dialog to download tools deps in the settings menu.#2020-07-2220:55salamrelated? https://clojurians.slack.com/archives/C0744GXCJ/p1594838128420400#2020-07-2221:04markbastianHmm, this is a deps.edn project and so we tried invalidating caches and restarting and no dice. We're also seeing a "could not create shim" error. Does that sound familiar?#2020-07-2221:30salamis the “Project” drop-down list empty on your Run Configuration window as well? if that’s the case then it might be an indication that there’s a problem with project/module resolution. you may want to check that your deps.edn doesn’t have any error and the project resolves successfully when you reimport it.#2020-07-2221:35markbastianI'll have him check that.#2020-07-2312:00cfleming@U0JUR9FPH The “could not create shim” error is the problem, I think. Could you reproduce the problem and send a copy of his log file to <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection>? Help | Show log in Finder/Explorer…#2020-07-2314:49markbastianI’ll ask him to do it.#2020-07-2315:10markbastianEmail sent. Thanks!#2020-07-2221:04markbastianHmm, this is a deps.edn project and so we tried invalidating caches and restarting and no dice. We're also seeing a "could not create shim" error. Does that sound familiar?#2020-07-2321:52kennyI was told a while ago to commit .idea/clojure-deps.xml to version control. I think it had something to do with branch switching not remembering your projects. While commiting it does solve that problem, it brings up a bunch of other issues. I don't have a repro but our team continually gets projects added or removed from the list without explicitly doing so. Also, adding a project outside of the git root will cause issues for everyone else that doesn't have that directory available. Is committing .idea/clojure-deps.xml still the right approach to get projects kept when switching git branches?#2020-07-2414:23onetomi usually don't have issues with that specific file, although the list in the <option name="projectFiles"> section might get reordered arbitrarily.
however, the upcoming intellij version would like to convert the configuration directory, so i can imagine that would confuse earlier versions, so im not yet switching to the next EAP, though it's in RC stage now.#2020-07-2409:07maxtWe have also experienced problems with commiting clojure-deps.xml. Mainly related to developers running different versions of idea and cursive and the contents jumps around, causing cursive to not detect it as a deps project any more.#2020-07-2410:19Paul NewberryHi, I'm trying to get Cursive working on Windows but I'm having a few problems. I've installed Clojure on Windows via the recommended way (as mentioned on the Cognitect website) and it is available via powershell. When trying to use this in Cursive however, it keeps defaulting to running in CMD. I've set the terminal path to be powershell.exe. I also get the error could not create shim
Does anyone know how to get this working? Any help would be much appreciated!#2020-07-2523:35cflemingCursive doesn’t support running via the command line on Windows yet. Here’s the recommended approach: https://cursive-ide.com/userguide/deps.html#windows#2020-07-2417:02cap10morganI'm getting the error Could not create shim in tools-deps projects after updating clojure to 1.10.1.561 and Idea to 2020.1.4. On both macOS 10.15.6 and Big Sur dev beta 3. Anyone else seeing that?#2020-07-2417:33onetomI have the same set of versions, but I haven't seen any error like that.
Where is that error appearing?
Are you using the Use CLI tools (recommended) option?#2020-07-2419:39cap10morganIt's a popup when I open the project. Where is that option?#2020-07-2422:32cfleming@U06FS3DLH Could you email me your log file from Help | Show log in Finder? <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection>. I’ll try to look at that over the weekend, someone else reported this yesterday too.#2020-07-2422:41cap10morganCan do!#2020-07-2515:39onetomI just got this shim error on macOS.
I switched to the Use tools.deps directly option yesterday and I'm on version 0.9.745
IntelliJ IDEA 2020.1.4 (Ultimate Edition)
Build #IU-201.8743.12, built on July 21, 2020
Licensed to Tamas Herman
Subscription is active until November 27, 2020
Runtime version: 11.0.7+10-b765.65 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.6
GC: ParNew, ConcurrentMarkSweep
Memory: 4029M
Cores: 8
Registry: suppress.focus.stealing.active.window.checks=true, suppress.focus.stealing.disable.auto.request.focus=true
Non-Bundled Plugins: AceJump, IdeaVIM, Org4Idea, PlantUML integration, TabSwitch, com.4lex4.intellij.solarized, com.alayouni.ansiHighlight, com.github.pshirshov.bytecodeeditor, zielu.gittoolbox, com.intellij.ideolog, com.intellij.plugins.watcher, com.paperetto.dash, com.vincentp.gruvbox-theme, de.netnexus.camelcaseplugin, de.thomasrosenau.diffplugin, io.protostuff.protostuff-jetbrains-plugin, name.kropp.intellij.makefile, net.vektah.codeglance, nix-idea, org.intellij.RegexpTester, org.jetbrains.plugins.localization, org.jetbrains.plugins.rest, com.dmarcotte.handlebars, com.cursiveclojure.cursive, Pythonid, ru.meanmail.plugin.requirements, com.intellij.plugins.html.instantEditing, com.jetbrains.plugins.jade, intellij.prettierJS, org.asciidoctor.intellij.asciidoc, org.plugin.dot.id, org.toml.lang, org.rust.lang#2020-07-2515:40cap10morgan@U0567Q30W Just emailed my log file#2020-07-2515:41onetomThen I switched back to Use CLI tools with this version:
/nix/store/q45vy8nvlfvz528hm1bp5fl6phy9gpi6-clojure-1.10.1.510/bin/clojure
and now I can start a REPL without triggering that shim error#2020-07-2509:47reefersleepIn Cursive,
(fn x [x]
x)
marks the parameter x as unused, even though (x 10) ;;=> 10. I know that this is a weird example, but I just thought I'd bring it up. #2020-07-2523:38cflemingHmm, interesting, looks like Clojure prioritises the parameter and Cursive prioritises the local fn name.#2020-07-2619:26reefersleepYeah, that’s what I figured, too.#2020-07-2509:55reefersleepDifferent issue, but related: is it possible for m to show parameters named either or _somename as unused? Clj-kondo complains that unused parameters should be named either underscore or be preceded by an underscore, and I get why; the source code, undecorated by syntax highlighting, will be more explicit about usage. And I agree with that reasoning; you don't always have syntax highlighting available._#2020-07-2509:56reefersleepPardon the formatting; I'm on mobile, and can't find the option to turn off the newish "smart" formatting in Slack.#2020-07-2509:57reefersleepOn to the point; underscore alone is a convention I'm used to seeing, but sometimes it's nice to give contextual hints by using a name preceded by an underscore, and this is new to me. And I am finding it much harder to ignore such a name.#2020-07-2509:59reefersleepIf Cursive were to gray out the underscored name, I'd find it much more agreeable; the underscored name would give you both a contextual clue and mark it explicitly as unused in a nonhighlighted context, and in Cursive, I'd be able to scan past it as I'm used to.#2020-07-2510:00reefersleepIs it possible for me to configure this in Cursive?#2020-07-2523:40cflemingInteresting, Cursive basically does the exact opposite of what you describe: the leading underscore basically means “don’t mark this as unused, because I know it is”. This is because marking something as unused is considered a light warning, and things like IntelliJ’s “jump to next error/problem” will pick it up.#2020-07-2619:15reefersleepI totally get that, @U0567Q30W, it’s reasonable behaviour. I realise that it’s a case of me wanting to have my cake and eat it too; I want to mark symbols in the source as explicitly unused with a leading _, but I also want Cursive to colorize them differently in order for me to more easily scan the code.#2020-07-2619:17reefersleepI figure that IntelliJ is so featureful that it might be able to do what I want through some (to me) obscure setting - or you might already have thought of this in Cursive somehow.#2020-07-2510:44raymcdermottSetting up IntelliJ in Linux without Clojure, cursive downloads 1.9. I had to uninstall Cursive, install 1.10.1 manually. Reinstall cursive and all good again.#2020-07-2515:36onetomwhen would cursive download clojure?
are you talking about loading a leiningen project or something?
im curious, because i was also just setting up a pop!_os + nix machine a few hours ago and experienced some strange error when it was trying to generate stubs.#2020-07-2523:36cflemingI’m curious about this too, the only time I can think of that Cursive downloads Clojure is when setting up a bare project with no dependency management.#2020-07-2619:33raymcdermottyes @U0567Q30W that was the case#2020-07-2510:45raymcdermottMaybe it’s just a dusty corner :)#2020-07-2601:11paul931224Hello everyone. I started to use Cursive a while ago, just for the parinfer mode. Now I read the user guide, and use it for more things. I very much like the File Structure option. Unfortunately it is not showing my (re-frame.core/reg-event-db :some-keyword some-function) type of functions. I guess because they are not def or defn . Is this somehow a solvable thing? Any help would be appreciated.#2020-07-2605:08cflemingCursive does provide support for re-frame forms including reg-event-db so I think that should work. Do you see a lot of things not being resolved, i.e. highlighted in yellow?#2020-07-2614:57paul931224yes, stuff like (.log js/console "something") and third party libraries implemented with npm and shadow-cljs, like material-ui.core#2020-07-2614:58paul931224I read about it being able to handle re-frame functions, do I need to make some further steps to reach this functionality?#2020-07-2602:48tapGetting this error and can't start repl.
#2020-07-2605:52cflemingHi @U05111TCS, this looks like a result of this issue here: https://github.com/cursive-ide/cursive/issues/2403. I’ve just released a fix for this in the latest EAP build, 1.9.3-eap1. If you’re not already signed up to get EAP builds you can check how to do that here: https://cursive-ide.com/userguide/index.html#eap.#2020-07-2611:13tapThank you#2020-07-2616:14tapConfirmed the issue is fixed by 1.9.3-eap1#2020-07-2622:07cflemingGreat, thanks for letting me know!#2020-07-2602:48tapjava.lang.RuntimeException: Could not create shim
at cursive.shim.ShimProvider.getShim(Shim.kt:136)
at cursive.shim.ShimProvider.withShim(Shim.kt:103)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:161)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:84)
at cursive.build.BuildSystemProjectDetails.getProjectDetails(BuildSystem.kt:42)
at cursive.build.BuildSystemProjectsManager$reimportAllProjects$$inlined$synchronized$lambda$1.run(BuildSystemManager.kt:143)
at cursive.build.BuildSystemUtil$runTask$1$1.run(BuildSystemUtil.kt:93)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:932)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:434)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$null$3(ProgressRunner.java:233)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:166)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:627)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:572)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:153)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:233)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: Syntax error compiling at (cursive/deps/relocate.clj:1:1).
at clojure.lang.Compiler.load(Compiler.java:7648)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at cursive.deps.command$eval138$loading__6721__auto____139.invoke(command.clj:1)
at cursive.deps.command$eval138.invokeStatic(command.clj:1)
at cursive.deps.command$eval138.invoke(command.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7177)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.load(Compiler.java:7636)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.lang.Var.invoke(Var.java:384)
at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.require(ClojureRuntimeShimImpl.java:78)
at cursive.shim.ShimBootstrap.apply(ShimBootstrap.java:29)
at cursive.shim.Shim$createShimProvider$1.apply(Shim.kt:68)
at cursive.shim.Shim$createShimProvider$1.apply(Shim.kt:23)
at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:143)
at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:85)
at cursive.application.ApplicationKt$sam$java_lang_Runnable$0.run(Application.kt)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:255)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
... 3 more
Caused by: java.io.FileNotFoundException: Could not locate clojure/tools/deps/alpha/reader__init.class, clojure/tools/deps/alpha/reader.clj or clojure/tools/deps/alpha/reader.cljc on classpath.
at clojure.lang.RT.load(RT.java:462)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:436)
at cursive.deps.relocate$eval1039$loading__6721__auto____1040.invoke(relocate.clj:1)
at cursive.deps.relocate$eval1039.invokeStatic(relocate.clj:1)
at cursive.deps.relocate$eval1039.invoke(relocate.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7177)
at clojure.lang.Compiler.eval(Compiler.java:7166)
at clojure.lang.Compiler.load(Compiler.java:7636)
... 65 more
#2020-07-2602:48tap
I've just updated clojure homebrew package. Not sure they are related.#2020-07-2606:14cfleminghttps://twitter.com/CursiveIDE/status/1287269735176892416#2020-07-2710:00onetomwhat's the workflow with cursive if someone wants to develop a library, but in the context of an application, which depends on that library?
i assumed that i would just provide a :classpath-overrides {some/lib "/Users/me/src/some-lib"} in ~/.clojure/deps.edn and then if i navigate to the library source code from my application's intellij project, i would end up in "/Users/me/src/some-lib" and i could just edit the file.
instead of this, i still end up somewhere inside ~/.m2/repositories/.../some/lib/...", like i would without the override and of course i can't edit the source code of some/lib`, since the opened file is coming from inside a jar.#2020-07-2716:52onetomMade a repro case to demonstrate this issue:
https://github.com/cursive-ide/cursive/issues/1641#issuecomment-664513197#2020-07-2718:40onetomadded more repro cases to a related issue:
https://github.com/cursive-ide/cursive/issues/2204#2020-07-2808:38cfleming@U086D6TBN Thanks for these examples, I haven’t had a chance to read them in detail yet but I should get to that tomorrow.#2020-07-2808:39onetomthat would be a great help because we are starting a new project in a monorepo and would like to use :local/root deps extensively#2020-07-2713:00Toby ClemsonHi all, I'm trying to write a clojure.test extension, i.e., a custom assert-expr implementation. I'd like to test this by intercepting clojure.test/report within some scope. However, Cursive's test runner appears to intercept clojure.test at some level higher up for its own purposes. Is there some way I can turn off Cursive's interception within some scope?#2020-07-2713:09imreYou could try running the test directly from the repl instead of through cursive#2020-07-2713:10imrealthough that won't help in the long term#2020-07-2713:39Toby ClemsonYes, I'm able to run the tests that way, or using other test runners like eftest. Was just hoping to maintain my current workflow.#2020-07-2714:16onetomor you can use a clojure.main REPL.
that doesn't have cursive test support#2020-07-2714:18Toby ClemsonI'm looking to maintain the Cursive test support whilst testing test infrastructure. An edge case I'm aware. After some digging I think I've got a solution. It appears Cursive redefs clojure.test/do-report. If I capture the original and redef it back within the scope of my test code, I can capture the reports:
(def do-report clojure.test/do-report)
(defmacro report-on [form]
`(let [reports# (atom nil)]
(with-redefs [clojure.test/do-report do-report]
(binding [clojure.test/report (fn [m#] (swap! reports# conj m#))]
(is ~form)))
(deref reports#)))#2020-07-2714:18onetomalso, maybe try to test your custom extension more directly somehow...
eg extract the code of it into functions and have tests for those bits only.
wiring it up to the test framework should be trivial code then, which you can omit tests for after observing it to work once.#2020-07-2714:20Toby ClemsonYes, I'll definitely pull out the bulk of the assertion logic. However there are some bits I'd like to test in the assert-expr implementation.#2020-07-2714:21Toby ClemsonWith this in place, I can write a test like:
(deftest logged?-exactly-matches-single-log-event
(let [logger (cartus-test/logger)
type ::some.event
context {:some "context"}
_ ^{:line 1 :column 1} (cartus-core/info logger type context)
report
(report-on
(logged? logger
{:level :info
:type type
:context context
:meta {:ns (find-ns 'cartus.test-test)
:line 1
:column 1}}))]
(is (= :pass (:type (first report))))))#2020-07-2714:21Toby ClemsonCan be cleaned up a little as there should only be one report but I'm capturing everything for now in order to test whether that assumption is correct 🙂#2020-07-2714:24onetomjust make sure you leave some notes in the code explaining why is it so convoluted ;D#2020-07-2714:25Toby ClemsonOf course 🙂#2020-07-2714:25onetomincidentally, i just came across cartus a few days ago and it's on my list of libraries to evaluate. just saying. as an inspiration 🙂#2020-07-2714:26Toby ClemsonGreat! Let me know if anything is unclear, I've tried to be quite comprehensive in the documentation but would be great to get feedback.#2020-07-2808:43cfleming@UDA9YHF8V Yes, you’re right that Cursive monkey-patches do-report. I can’t remember all the gory details, it was a long time ago, but IIRC I had to do it at that level to get the metadata from failing forms, which I need to paint the passed/failed icons. I’ve been planning to investigate using eftest instead, but (also IIRC) part of the problem was actually in the is macro and the way assert-expr works. I’d have to go back and dig into the code in depth to remember all the details though.#2020-07-2809:00Toby Clemson@U0567Q30W Ok great, thanks. I have something up and running that's working nicely by capturing and rebinding clojure.test/do-report within the scope of my test so it's no longer a problem 🙂#2020-07-2809:00cflemingGreat 🙂#2020-07-2816:56kennyWhen I manually mark a directory as excluded Cursive (IntelliJ?) doesn't seem to always persist that. Is there a way to make that sort of change more permanent?#2020-07-2821:34cflemingI think that should always be persisted. When does that tend to get lost? Restarting the IDE, or just re-opening a project?#2020-07-2821:36kennyWell, I updated to 2020.2 and all of them disappeared. It seems to happen on other occasions as well though. I can always tell because it starts to think real hard on shadow-cljs cache directory or cljs output files when those dirs are not excluded.#2020-07-2914:09folconIs anyone having any issues with deps.edn :extra-paths not being respected as source roots? I keep having to reapply mine constantly... Not sure what I'm doing wrong#2020-07-3002:00cflemingYou probably need to tell Cursive which aliases to sync: https://cursive-ide.com/userguide/deps.html#working-with-aliases#2020-07-3012:36folconOh, I didn’t realise that’s what that meant =)… Thanks!#2020-07-2915:44bedersHey there. IntelliJ idea 2020.2 was just released. Any known issues with Cursive? Ie is it safe to update? #2020-07-3002:01cflemingI think so, I’m using it with no problems.#2020-07-2915:59imreOn that note, are there any goodies in 2020.2 for those of us who mainly only work with clojure? year.x->y upgrades are always a little more involved when it comes to idea#2020-07-2917:08bedersthere's better support for dealing with pull-requests and reviews right in the IDE. Also, finally a separate Problem window.#2020-07-2917:09bedersAlso git commit squashing and faster indices (even shared indices)#2020-07-2921:01imreInteresting, thank you!#2020-07-3002:02cflemingHere’s the feature announcement: https://blog.jetbrains.com/idea/2020/07/intellij-idea-2020-2-is-released/#2020-07-3002:02cflemingThere’s nothing Clojure specific in there, but things like Shared Indexes might be interesting too. I haven’t had time to play around with them yet, though.#2020-07-3005:00onetomwhat i missed the most for the past half year is that they allow again putting the Diff preview in the VSC log tool window on the side as opposed to below the log entries.
depending on screen size and whether you just study code, browse or preparing to review, both locations can make a lot of sense.#2020-07-3005:04onetomalso, everything is faster. by not much, but noticeably faster to make it feel smoother even on a 2012 3.4GHz Quad-Core i7 iMac#2020-07-3009:44imrespeed is always a good reason to upgrade, thanks#2020-07-2916:56hayley@beders I'm new to Cursive so I could be missing something, but I had problems with 2020.2 and importing projects that were started outside of Cursive. Starting a new project inside of Cursive worked though. And I didn't seem to have this problem with 2020.1.
@cfleming is github where bugs should be reported?#2020-07-3002:03cflemingYes, please, link is in the channel title.#2020-07-2917:13hayleyDoes Cursive have the equivalent of the equivalent of #dbg behavior? Like I can do the below and it will show me the output of each individual step.
#dbg
(->> (range 10)
(take 5)
(map #(* % 2)))
I tried messing with breakpoints but it didn't seem to have the equivalent behavior when doing a step over or step into.#2020-07-3002:07cflemingNo, there isn’t at the moment. I’d like to integrate the stream debugger with Cursive, but haven’t managed to look at that yet.#2020-07-2919:22vlaaadIs it possible to create a repl run configuration for new -X:alias feature of tools-deps?#2020-07-2919:41Alex Miller (Clojure team)what's a run configuration?#2020-07-3005:06onetomthis question reminded me the "what is love?" song :)
https://www.youtube.com/watch?v=HEXWRTEbj1I#2020-07-3005:15onetom@U064X3EF3 im super excited about these new cli options.
you are doing some amazing, fundamental work at cognitect.
it feels like you are slowly but surely pulling the industry out of the tar pit 🙂#2020-07-2919:41Alex Miller (Clojure team)oh sorry, didn't realize I was in #cursive nvm#2020-07-3007:57wegiWhen I have a tools-deps alias which has -m any.cool.class as main-opts the cursive nrepl seems to ignore those, when started with that alias. Am I doing something wrong or is this intended behaviour?#2020-07-3008:36onetomhow does your run configuration look like exactly?
maybe u can just paste the corresponding XML here from your .idea/runConfiguration or .run folder#2020-07-3008:38wegiSure.
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="CLJ REPL" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false">
<module name="meetly" />
<setting name="replType" value="NREPL" />
<setting name="execution" value="DEPS" />
<setting name="jvmArgs" value="-Dghostwheel.enabled=true" />
<setting name="parameters" value="" />
<setting name="workingDir" value="$PROJECT_DIR$" />
<setting name="profiles" value="" />
<setting name="aliases" value="run-server" />
<setting name="fixLineNumbers" value="false" />
<method v="2" />
</configuration>
</component>
The run-server alias has a main-opt -m project.server. Its main is never executed. I even put non-existing function-calls in to see if it breaks. But it does not run at all.#2020-07-3008:41wegiWhen i do clj -A:run-server it works just fine. But of course I would like to have it inside of my nrepl#2020-07-3008:46onetomokay, so this is a Local nREPL config.
IntelliJ have to tell your app to start an nREPL server, so the IntelliJ process can connect and talk to it.#2020-07-3008:47onetomwhen u start it from the command line, there is no need for a server, because your application process is accepting input from the stdin directly#2020-07-3008:50onetomif u click on the line which appears at the top of your Cursive REPL window, it should expand to a very long command line.
at the end of that command-line, there is a -i <some/randomly/named.clj>.
that is the program which executes first and enters an nREPL server loop.
because of that, no other code has the chance to interpret the -m option from the command-line.#2020-07-3008:50onetom(or something like that; can't remember it precisely)#2020-07-3008:55wegiThanks, so there is no option to start the -main function inside the newly created nrepl, except of doint it by hand then?#2020-07-3114:51onetomim not sure i understand that question, but at the same time im not sure i can explain it more precisely either.
how i understood this was by reading the source code of clojure.main/-main
https://github.com/clojure/clojure/blob/master/src/clj/clojure/main.clj#L616-L674
which is referenced from this java entry point:
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/main.java#L23#2020-07-3114:53onetomnothing really beats reading the source code, when it comes to understanding how things work 🙂#2020-07-3100:09lsenjovIs there a command to trigger stub generation?#2020-07-3104:50onetomi missed that the other day too...
also, i have a monorepo with 4-5 clojure projects in it now and im being asked 4-5 times whether i want to generate stubs.
that would be great if i could just say yes 1 time 🙂#2020-07-3105:26cflemingThere isn’t, but there should be. You can provoke the check by refreshing your lein/deps project from the corresponding toolwindow as a workaround.#2020-07-3105:27cfleming@U086D6TBN You should only be asked once for that, I think. Do you mean you have multiple deps projects in a single IntelliJ project?#2020-07-3105:27onetomyes. i have multiple deps modules#2020-07-3105:33onetomif i understand correctly, we should version control the .idea/clojure-deps.xml files.
they contain system aliases though, which might not be present on other systems.
those are not transferrable to other machines and iirc they got cleaned up automatically, resulting in an unnecessary churn in changes to this file.
what can we do about it?
would it make sense to put the system aliases into a different file, which can be gitignored?#2020-07-3105:38onetomof course turning aliases on and off might also result in changes to the .iml files of other the intellij deps modules, eg:
- <orderEntry type="library" name="Deps: vlaaad/reveal:d0fe22" level="project" />
+ <orderEntry type="library" name="Deps: Local vlaaad/reveal" level="project" />
i have no idea what to do about that.#2020-07-3105:41onetomand the alias checkboxes are still buggy.
if i click them nothing seems to happen, but if i move up/down in the alias tree, then they update and reflect the new state.
initially i thought it should be just my system, but i've seen the same behaviour on 3 other machines too, so i think it's a bug#2020-07-3106:00onetomhmmm... my run configurations i put in .run/ are not showing up amongst the other ones, which are still under .idea/runConfigurations.
how can i make cursive aware of the ones in .run/ ?#2020-07-3106:02cflemingI’m not sure, actually. How are you putting them under .run/?#2020-07-3106:03cflemingOh, I see - there’s a “Store configuration file in…” option - I think that’s new, or at least I don’t remember seeing it previously.#2020-07-3106:03onetomoriginally they were added under the old location, then the other day i clicked on that cog next to the Store as project file and changed the path to .run#2020-07-3106:04onetomoh, that's not a cursive feature?#2020-07-3106:04cflemingCould you file an issue for that? I’m not sure what’s going on there. It looks to me like they’re expecting run configs to be in one location, rather than two.#2020-07-3106:04cflemingNo, that’s IntelliJ doing that.#2020-07-3106:04cflemingBut that you can now specify what that location should be.#2020-07-3106:05onetomaaah... so that's supposed to be a per-project option, not a per run-config!
it's not clear from the UI...#2020-07-3106:05onetombeacuse it shows different paths for the different run configs#2020-07-3106:18onetomso the references to the run configs are stored in workspace.xml, which is not under version control (and correctly so), so im not sure how this new feature is meant to work... 😕
also, i think i've started intellij community editor over this project recently and that might have tangled these settings up, since i had some python run configs too, which are not supported under the CE#2020-07-3106:23onetomworkspace.xml has this kind of magic too, to deal with chaning the run config location:
<component name="ChangeListManager">
<list default="true" id="73adb5ea-abbc-47f9-83c2-475bd4854522" name="Default Changelist" comment="Reveal integration and documentation">
<change beforePath="$PROJECT_DIR$/.idea/runConfigurations/Datomic_testbed.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.run/Datomic testbed.run.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/runConfigurations/Recurrence_REPL.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.run/Recurrence REPL.run.xml" afterDir="false" />
...
</list>#2020-07-3106:01onetomi've also noticed that one of those files have a lot of repetition in them. smells like a bug:
xml
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Rule Crib" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
<module name="rule-crib" />
<setting name="replType" value="NREPL" />
<setting name="execution" value="DEPS" />
<setting name="jvmArgs" value="" />
<setting name="parameters" value="" />
<setting name="workingDir" value="$PROJECT_DIR$/rule-crib" />
<setting name="profiles" value="" />
<setting name="aliases" value="datomic-peer,expect,dev" />
<setting name="fixLineNumbers" value="false" />
<method v="2" />
</configuration>
<configuration default="false" name="Rule Crib" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
<module name="rule-crib" />
<setting name="replType" value="NREPL" />
<setting name="execution" value="DEPS" />
<setting name="jvmArgs" value="" />
<setting name="parameters" value="" />
<setting name="workingDir" value="$PROJECT_DIR$/rule-crib" />
<setting name="profiles" value="" />
<setting name="aliases" value="datomic-peer,expect,dev" />
<setting name="fixLineNumbers" value="false" />
<method v="2" />
</configuration>
<configuration default="false" name="Rule Crib" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
<module name="rule-crib" />
<setting name="replType" value="NREPL" />
<setting name="execution" value="DEPS" />
<setting name="jvmArgs" value="" />
<setting name="parameters" value="" />
<setting name="workingDir" value="$PROJECT_DIR$/rule-crib" />
<setting name="profiles" value="" />
<setting name="aliases" value="datomic-peer,expect,dev" />
<setting name="fixLineNumbers" value="false" />
<method v="2" />
</configuration>
<configuration default="false" name="Rule Crib" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
<module name="rule-crib" />
<setting name="replType" value="NREPL" />
<setting name="execution" value="DEPS" />
<setting name="jvmArgs" value="" />
<setting name="parameters" value="" />
<setting name="workingDir" value="$PROJECT_DIR$/rule-crib" />
<setting name="profiles" value="" />
<setting name="aliases" value="datomic-peer,expect,dev" />
<setting name="fixLineNumbers" value="false" />
<method v="2" />
</configuration>
<configuration default="false" name="Rule Crib" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
<module name="rule-crib" />
<setting name="replType" value="NREPL" />
<setting name="execution" value="DEPS" />
<setting name="jvmArgs" value="" />
<setting name="parameters" value="" />
<setting name="workingDir" value="$PROJECT_DIR$/rule-crib" />
<setting name="profiles" value="" />
<setting name="aliases" value="datomic-peer,expect,dev" />
<setting name="fixLineNumbers" value="false" />
<method v="2" />
</configuration>
<configuration default="false" name="Rule Crib" type="ClojureREPL" factoryName="Local" activateToolWindowBeforeRun="false" singleton="true">
<module name="rule-crib" />
<setting name="replType" value="NREPL" />
<setting name="execution" value="DEPS" />
<setting name="jvmArgs" value="" />
<setting name="parameters" value="" />
<setting name="workingDir" value="$PROJECT_DIR$/rule-crib" />
<setting name="profiles" value="" />
<setting name="aliases" value="datomic-peer,expect,kaocha,dev" />
<setting name="fixLineNumbers" value="false" />
<method v="2" />
</configuration>
</component>#2020-07-3107:41EmpperiSeems like structural editing choices don't show up anymore in the taskbar. Even though they are selected to be shown. Disabling the selection and re-enabling it won't matter.#2020-08-0101:43cflemingWhich version of Cursive are you using? There was a bug with this which was fixed in 1.9.2.#2020-08-0605:20Empperi@U0567Q30W sorry, missed your question but I had answered that just in the next message 🙂 The version was 1.9.3-2020.2#2020-08-0605:21EmpperiJust got an update to 1.9.4-eap1-2020.2 where this issue seems to have gone away 👍#2020-07-3107:41EmpperiVersion 1.9.3-2020.2#2020-07-3115:58TrevorOn OSX what's the key binding to send the currently highlighted form (even if it's nested inside another form?) to the REPL? I'm using <CMD>+p and that's great but would be cool to send just a nested bit of the form
I'm failing to find it so I figured I'd just ask, thanks!#2020-08-0101:41cflemingThere isn’t one for “surrounding sexp”, but if you have a form selected then all the “Send xxx to REPL” actions will send that instead of what they would normally send. So you can select the form using Alt-up arrow and then use Cmd-P.#2020-08-0109:17onetomI've also assigned Ctrl-Enter (aka Cmd-Shift-P) to Eval top form
and Ctrl-Shift-Enter to Eval form before caret, so I can just move to the end of a form and Ctrl-Shift-Enter just that. it's often followed by a Ctrl-Enter to eval the whole, containing form too if I were happy with the evaluation result of the sub-form.#2020-08-0109:26onetomon that note, i often find myself wanting to evaluate a sub-form, which comes right after my cursor.
i was wondering if it would be possible to create a composite action, which does all this at once.
if there is an ambiguity, maybe a popup can show the alternatives, just like the variable extraction popup.
the rules could be similar to how the Alt-Up Extend Selection decides what to highlight, but favoring sequences as opposed to individual tokens.
in other words, when i press ctrl-shift-enter, i would like it to be the combination of a more greedy alt-up + ctrl-enter.#2020-08-0109:27onetomi could describe such an action as Eval around caret or Eval in caret's vincinity#2020-08-0200:01cflemingThe problem with these sorts of actions is the combinatorial explosion of <form selection>/<how to eval>/<what to do with the results>. Lots of people have asked for an eval which puts the result in a comment in the source file. So I’m planning to extend the REPL commands feature to allow people to build the particular commands they want out of component pieces.#2020-08-0112:48onetomI'm getting a Cannot disambiguate overloads of ProcessBuilder warning from Cursive in the (defn build-process [cmd] ... (java.lang.ProcessBuilder. cmd) ...) expression.
It also manifests at runtime as this message:
Reflection warning, /Users/onetom/.../src/testbed.cljc:92:9 - call to java.lang.ProcessBuilder ctor can't be resolved.
I tried to add ^List in front of cmd and that made the issue go away, but List is not defined in Babashka...#2020-08-0112:50onetomwhat is the most generic type I should use in these situations?
the constructor is defined to accept "var-args" and I read somewhere, to call such functions, Clojure should provide them with some array-ish thing.#2020-08-0113:08Alex Miller (Clojure team)https://clojure.org/guides/faq#varargs#2020-08-0113:15onetom(require '[clojure.reflect :as r])
(import '[clojure.reflect Constructor])
(->> (r/type-reflect ProcessBuilder)
:members
(filter (comp #{Constructor} type)))
(#clojure.reflect.Constructor{:name java.lang.ProcessBuilder,
:declaring-class java.lang.ProcessBuilder,
:parameter-types [java.util.List],
:exception-types [],
:flags #{:public}}
#clojure.reflect.Constructor{:name java.lang.ProcessBuilder,
:declaring-class java.lang.ProcessBuilder,
:parameter-types [java.lang.String<>],
:exception-types [],
:flags #{:varargs :public}})#2020-08-0113:17onetomI'm wondering if there is a literal form for java.lang.String<> to use it as a type hint 😕#2020-08-0113:19onetom^Ljava.lang.String or ^java.lang.String<> doesn't work..#2020-08-0113:20borkdude@U086D6TBN This works with both bb and clj:
$ bb -e '(set! *warn-on-reflection* true) ((fn [& args] (ProcessBuilder. ^java.util.List args)) "ls")'
#2020-08-0113:20borkdudeSo you get your reflection avoided and also compatible with bb#2020-08-0113:22borkdudeList is not a thing both in bb and clj without importing it or fully qualifying it#2020-08-0113:22onetombb -e '(import (quote [java.util List])) ((fn [& args] (ProcessBuilder. ^List args)) "ls")'
java.lang.Exception: Unable to resolve classname: java.util.List [at line 1, column 1]
#2020-08-0113:23onetomi was importing it in Clojure and as i mentioned it made Cursive happy, but not bb#2020-08-0113:24onetomCursive recommends using the short form of fully qualified class references; that's how I cornered my self 🙂#2020-08-0113:25borkdudeAh right, bb allows you to use type hints without actually needing those classes to be in bb#2020-08-0113:25borkdudejust for compatibility#2020-08-0113:27onetomi can't remember reading about this in the bb docs so far.
might worth mentioning it#2020-08-0113:28borkdudeit will try to use the type hint if it can resolve the class#2020-08-0113:29onetomi feel like to make bb a good alternative to bash, using any kind of external process related functionality should be really friendly#2020-08-0113:30borkdudeI think it might be better to just add the java.util.List class to bb (I was kind of surprised it wasn't already in there)#2020-08-0113:35borkdudeIf vec would have a return type tag on it, one could do this with (ProcessBuilder (vec args)) right?#2020-08-0114:11onetomare you asking me?
i don't know. i didn't have to deal with type metadata much on my clojure journey so far 🙂
im not even sure where should the return type tag go. on the var or the arg vector...#2020-08-0114:13onetomwhich is i think a testament to how practical clojure is 🙂
i've trained a few people clojure over the past ~5 years. wrote a bunch of useful programs, even in clojurescript with hoplon, yet there was hardly any need to deal with type tags.#2020-08-0114:15borkdudeIf you use this function:
(defn vec2 ^clojure.lang.PersistentVector [x]
(vec x))
around your arguments to ProcessBuilder, the reflection warning goes away, because PersistentVector implements List. Maybe there's a reason why clojure.core doesn't have the type tag on vec as of now. @U064X3EF3?#2020-08-0115:09Alex Miller (Clojure team)Generally, collections are never hinted with the concrete type - it just relies on polymorphism are the call site#2020-08-0115:10Alex Miller (Clojure team)The return here is not necessarily that type either#2020-08-0115:11Alex Miller (Clojure team)If you make your own concrete vector collection, and call vec on it, you’d get that type#2020-08-0115:12borkdudeok, makes sense#2020-08-0308:26reefersleepThis is really more of an IntelliJ question, but perhaps someone here has an idea about this, since it’s relevant in a Clojure context.
In the interest of keeping lines short, I might sometimes break up a string literal in more than one line, eg.
"This is my
multiline string"
If I were to search for this in IntelliJ, I’d normally just use “Find in Path” (CMD F on Mac). However, if I typed this into the search field, I would find nothing: This is my multiline. I’d have to turn regex on and search for This is my\s*multiline. However, since I won’t know where line breaks are, I’d really have to search for This\s*is\s*my\s*multiline.
This becomes really cumbersome really quick!
I wonder if there’s a way to assume or specify that each space in a search represents \s*? Or some other, smart way to search for this type of literal?#2020-08-0311:43manutter51I don’t know any way to directly do what you want, but you could set up a Live Template that would make it easy to generate your search string in a REPL..#2020-08-0313:05reefersleepNot exactly what I’m looking for, but it’d be a help. How do I make it available to the REPL?#2020-08-0313:07manutter51Once you define it you can use it in either the repl or the editor just by typing as[TAB]#2020-08-0313:07manutter51where [TAB] is the TAB key, of course.#2020-08-0407:22reefersleepCheers @U06CM8C3V, an extra weapon for the arsenal 🙂#2020-08-0411:30manutter51:thumbsup:#2020-08-0311:44manutter51(println (clojure.string/replace "Here is some test text." " " "\\s+"))
Here\s+is\s+some\s+test\s+text.
#2020-08-0401:03cfleminghttps://twitter.com/CursiveIDE/status/1290452435216072704#2020-08-0600:19steveb8nQ: I’m having stability issues with Idea crashing. To fix, I’d like to update from 2019.3 so I’m exploring compatibility. I always find this difficult: I want to know the two pairs of stable/eap and supported Idea versions for each. The user guide states the requirement for stable (not alway certain it’s up to date) but eap means scrolling through the google group messages. could both of these pairs be documented in one place to it’s easy to check?#2020-08-0600:21steveb8nI also noticed this info in the plugins section of Idea… Built on: 2020-07-02 14:17
Built from: 1.9.2-68-g08c574e5#2020-08-0600:21steveb8nI presume this provides the edges of the supported range?#2020-08-0600:22steveb8nI would find it very useful to have all this stuff in one place, known to always be up to date. Is that possible?#2020-08-0600:24steveb8nAn extra cherry on top: if this web page could also explain the versioning semantics of Cursive and how they relate to Ideas versions, that would help. I’m pretty sure this is already out there somewhere#2020-08-0600:27steveb8nMy goal now is to understand if I can upgrade Idea to 2020.2.#2020-08-0600:28steveb8ndespite this sounding like a gripe, it’s not 🙂 just a hopeful request#2020-08-0601:25cflemingBasically, I need proper release notes and change log 🙂. And the answer to that is that yes, yes I do.#2020-08-0601:26cflemingFor your particular case, you should be able to update to 2020.2 and use either the latest stable or EAP with that with no problem.#2020-08-0602:28steveb8ngreat. thanks for a concise response to a long winded question 🙂#2020-08-0611:23reefersleepIs it correctly understood that Cursive does not support breakpoints at all for .cljs at this time?
I thought that it didn’t make sense, as your browser is usually the execution environment for CLJS, and the connection between the browser and the IDE is “weaker” than e.g. a Clojure REPL and the IDE, but it seems I was misinformed. Other IDEs support breakpoints in JS. My face was like 😮 when I discovered this.#2020-08-0612:00armedHello. I'm using tools deps. How to force cursive load all paths namespaces when REPL starts? By default in no project namespaces is loaded.#2020-08-0622:32cflemingThere isn’t a good way in Cursive to do this right now. However you can use a user.clj file, which is a Clojure thing.#2020-08-0612:02armedFor example I have :paths ["src" "test"]. And when I try run some tests, it shows me error that can't find init files of namespaces from src. Then I have to manually load root namespace into repl.#2020-08-0612:05armedhere is my run configuration#2020-08-0705:47armedOk, I was experimenting with single deps.edn for monorepo with multiple modules and got all working now. Previous dumb question is not relevant anymore 🙂#2020-08-0901:50ashkHi all 🙂
Thanks for making cursive - great tool! 👏
I’m just getting started with clojure & cursive, i’m trying to get into the swing of the development workflow.
Just wondering if cursive can do code completion when editing deps.edn files for resolving package names and versions.
I’m thinking along the line of the npm package tools for intellij.
thanks :)#2020-08-0904:58ashkJust having some difficulties with creating a new deps project
Cursive doesn’t seem to be indexing the clojure library so i’m getting warning such as “ns cannot be resolved”
Also the Dependencies in the Clojure Deps view aren’t being populated
I’m I doing something dumb?
Please see attached screenshot
Cursive: 1.9.4-eap1-2020.2
IntelliJ IDEA 2020.2 (Ultimate Edition)
Build #IU-202.6397.94,#2020-08-0921:04jaimeHello, previously when I run failing tests using cursive, it will show a pop-up and there is a link "show difference". Right now I don't see it anymore
Cursive Version: 1.9.2-2020.1
IntelliJ IDEA 2020.1.3 (Community Edition)
Build #IC-201.8538.31, built on July 7, 2020
Runtime version: 11.0.7+10-b765.64 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.4
GC: ParNew, ConcurrentMarkSweep
Memory: 2014M
Cores: 4
Registry: ide.balloon.shadow.size=0
Non-Bundled Plugins: com.alicannklc.tailwind, com.chrisrm.idea.MaterialThemeUI, SQL Query Plugin, com.intellij.plugins.watcher, com.cursiveclojure.cursive#2020-08-1000:57cfleminghttps://twitter.com/CursiveIDE/status/1292623354105495557?s=20#2020-08-1021:22jaimeI'm trying to follow the answer (below link) to require namespaces in the repl using cursive Tools→REPL→Load file in REPL
However after loading the file, I'm expecting that the namespaces required in that file will be loaded, but they are not. I'm still getting No such namespace error. Is it expected behaviour?
https://stackoverflow.com/a/27682091/1730988#2020-08-1118:17jaimeI've tried it on two namespace. The src/limeray/api/util.clj has only this content
(ns limeray.api.util
(:require [tick.core :as t]))
(t/new-date) ;; I'm trying to send this to repl after loading this ns
(defn uuid
([]
(java.util.UUID/randomUUID))
([uuid-string]
(java.util.UUID/fromString uuid-string)))
#2020-08-1118:20jaime#2020-08-1118:25jaimeHmm after playing with it, I guess I'm doing silly mistake.
My repl should be in the same namespace of the file in order for the symbols to be available 😅#2020-08-1107:03jysandyI have a clj + cljs project with both a Leiningen project.clj for the backend code and a shadow-cljs.edn for the frontend. I exported a pom.xml using shadow-cljs, but importing that seems to break dependency resolution using Leiningen since a module can only be managed by one build tool at a time. Is there a workaround for this besides integrating shadow-cljs with Lein completely?#2020-08-1107:04jysandyBoth the project.clj and the shadow-cljs.edn are sitting in the same project root.#2020-08-1107:07jysandyIf moving the Lein project to use deps will help, I’m open to exploring that.#2020-08-1109:09thheller@jysandy probably best to configure your CLJS dependencies in project.clj and then make shadow-cljs use that too. less of a hassle overall to just have one place to declare dependencies. if you don't mind copying you can also just copy your CLJS dependencies to project.clj under the :dev profile or so that Cursive can find it but still actually use shadow-cljs.edn for CLJS deps#2020-08-1118:09salamthere seems to a bug with the way cursive evaluates calls to clojure.core/pr and clojure.core/print. i used a few expressions to compare the behavior of cursive's repl client to that of clojure's built-in repl client. both clients are connected to the same clojure socket repl server. the results are shown in the following screenshots. is there any github issue tracking this bug?#2020-08-1118:21Alex Miller (Clojure team)pr and print don't force a flush#2020-08-1118:22Alex Miller (Clojure team)you may be observing some independent difference in when the output stream is flushed#2020-08-1803:15cflemingActually I based Cursive’s socket REPL code on prepl, and prepl has the same bug:
~> telnet 127.0.0.1 5555
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
(+ 1 2)
{:tag :ret, :val "3", :ns "user", :ms 17, :form "(+ 1 2)"}
(pr 1 2 3)
{:tag :ret, :val "nil", :ns "user", :ms 3, :form "(pr 1 2 3)"}
(prn 1 2 3)
{:tag :out, :val "1 2 31 2 3\n"}
{:tag :ret, :val "nil", :ns "user", :ms 1, :form "(prn 1 2 3)"}#2020-08-1803:15cfleming@U064X3EF3 @UDCGPTV9R ^^#2020-08-1803:17cflemingI can’t figure out the right place to fix this for the moment, but I’m looking into it.#2020-08-1803:17cfleming(binding [*out* out, *flush-on-newline* true, *print-readably* true]
(locking lock
(prn (if (#{:ret :tap} (:tag m))
(try
(assoc m :val (valf (:val m)))
(catch Throwable ex
(assoc m :val (ex->data ex :print-eval-result)
:exception true)))
m))))#2020-08-1803:17cflemingHere, the *flush-on-newline* doesn’t seem to work, even though prn is used.#2020-08-1803:35cflemingActually, I lie, I was getting my streams confused. *out* needs to be flushed before calling out-fn with :tag :ret or :tag :error if any eval might have output anything.#2020-08-1803:35cflemingI have this fixed for Cursive.#2020-08-1804:10salamThank you very much, Colin! I really appreciate the time you’ve taken out of your busy schedule to fix this. 🙂#2020-08-1805:23cflemingNo worries, sorry it took so long to get to! I’ll try to get an EAP out with this shortly.#2020-08-1118:38salamyeah, that's what i figured (when the output stream gets flushed) and was a little hesitant to call this a bug. however, i believe, i was bitten by this a few times in some other contexts in the past ~(i vaguely remember one of them being clojure.test)~.#2020-08-1120:23salamah, after hours of sifting through the clojurians slack log, i finally found what it was. i was wrong, it wasn't clojure.test, it was expound. here is the problem we ran into: https://clojurians-log.clojureverse.org/cursive/2020-06-09/1591730202.130400#2020-08-1120:24salam> i'm curious how everybody's experience with using a remote socket repl with cursive is. we've been having problems with this set-up. one particular problem that we had today was that the cursive repl client wouldn't show the output from expound. that is if you evaluate (expound/expound string? 42), all you get in the repl client output is nil. am i missing something?#2020-08-1120:33salamhere is, i believe, how this difference manifests itself as a bug in cursive's repl client:#2020-08-1120:34salamand that was very confusing back then...#2020-08-1204:54salam@cfleming would you please take a look at this problem above? i can submit a github issue. we use clojure spec for business entity and logic validation at work. as we all know, libraries like expound make clojure spec and it’s error messages a lot nicer and friendlier to work with. we have a workaround (force-flushing output stream using a prn) but since it’s not something you would do normally, it gets tedious and tiring overtime, not to mention forgetting to do it completely and getting confused all over again. this is also one of the bugs (including being bombarded with cursive exceptions at least 100 times a day) that cause eye-rolls from people who are just skeptical about everything clojure. thanks in advance!#2020-08-1205:19cflemingSure, I’ll take a look - thanks for the repro cases.#2020-08-1205:10salami don’t know if this helps, but please take that request as from a cursive commercial-license user who caused a one-time purchase of 40 commercial licenses a few years ago and is now trying to maintain that number at 20.#2020-08-1306:47gibbREPL Commands bound to shortcuts are pretty sweet!#2020-08-1306:49gibbCan I access my own REPL commands in the cursive.actions list somehow? I remember looking a big text file with cursive actions for making ideavim bindings but I can't seem to remember where I found it..#2020-08-1306:50gibbmap <leader>x :action :cursive.actions.paredit/kill-sexp<CR>
Something like that but instead cursive.actions.MyREPLCommand ?#2020-08-1306:50gibbAh :actionlist is what I was looking for..#2020-08-1313:38cjsauerWas your REPL action in that list? I was attempting to do this as well and couldn’t find it. #2020-08-1404:51gibbNope the REPL command does not show up there, I did not find a way to bind it to a vim shortcut.#2020-08-1308:13mishajust wanted to share that unbalanced " in comments breaks parinfer's smart mode:
(let [] ;
{:a 1
:b 2})
;tab second line:
(let [] ;"
{:a 1
:b 2})
;vs expected:
(let [] ;
{:a 1
:b 2})
but then found disclaimer: https://shaunlebron.github.io/parinfer/#inserting-quotes opieop#2020-08-1308:14mishaI hope mentioning it will save some time and sanity for somebody with a suddenly broken smart mode in a large ns#2020-08-1320:13pmallettI have a deps alias with the following.
:dev {:extra-paths ["dev/src" "dev/resources"]
:extra-deps {environ {:mvn/version "1.1.0"}
org.clojure/tools.namespace {:mvn/version "0.2.11"}
org.clojure/tools.nrepl {:mvn/version "0.2.12"}
reloaded.repl {:mvn/version "0.2.4"}}
:main-opts ["-i" "dev/src/foobar/user.clj"
"-e" "(in-ns,'foobar.user)"]}
The main-opts works when I start a repl from the command line.
clj -A:dev -r
But it does not work when I use nREPL in Cursive run config.#2020-08-1320:15Alex Miller (Clojure team)"does not work" = ?#2020-08-1320:16pmallettload the file and switch to the ns. Similar to this in leiningen.
:repl-options {:init-ns foobar.user}#2020-08-1321:28salamwhat does your run configuration look like?#2020-08-1322:30katoxCursive ignores the -m part of deps. Which is good in a way because it only supports -A#2020-08-1407:58ashkHi all,
i’m a cursive + ideavim user 🙂
Just wondering if anyone can help me:
i’m trying my darnedest type this into the editor:
(d/q {:query '[:find ?e
:where [?e :artist/name "The Beatles"]]
:args [db]})
But I’m having difficulty with the ’[ syntax#2020-08-1410:58thheller@ashk I also use cursive + ideavim and have no such issue. I'm also using paredit though. do you maybe have any other plugin active that tries to handle parens? I think there are some?#2020-08-1411:13ashki’ve disabled vim emulation and it’s still happening…. I’ve just got the cursive & rainbow brackets installed.
I think i’m on a EAP build.. i might try a fresh install of cursive
thanks @thheller!#2020-08-1500:14cflemingI can’t see how Cursive would ever cause that behaviour. Have you tried disabling the rainbow brackets plugin? Cursive actually has its own rainbow brackets (Preferences | Languages & Frameworks | Clojure | Appearance options | Rainbow parentheses) so you shouldn’t need that.#2020-08-1501:58ashkWell this is embarrassing, I had mapped the [ to “wrap with []“…
foolish, but I think my thoughts were that this would apply to vims command mode only
disabled the idea key mapping and all is well now
thanks @thheller & @cfleming#2020-08-1502:46cflemingNo worries, glad it’s working 🙂#2020-08-1415:35kennyWhen calling datomic.client.api/client, I get this exception:
Syntax error (FileNotFoundException) compiling at (datomic/client/impl/shared.clj:1:1).
Could not locate cognitect/hmac_authn__init.class, cognitect/hmac_authn.clj or cognitect/hmac_authn.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
That namespace is provided by the com.cognitect/hmac-authn dep. I can call clj -A:<all my aliases> -Stree -Sforce and see that hmac-authn is being brought in by com.datomic/dev-local 0.9.184. In the Clojure Deps panel under my project's Dependencies, I do not see hmac-authn under dev-local. I have Cursive set to use CLI tools under Clojure Deps. My clojure CLI version is 1.10.1.561. My Cursive version is 1.9.4-eap2-2020.2. This occurs in a REPL configured to use nREPL ran with the IntelliJ project classpath. I have tried restarting the REPL, hitting the Clojure Deps refresh button, and restarting my computer. Any idea why this would happen?#2020-08-1415:38kennyThe dev-local part of -Stree
com.datomic/dev-local 0.9.184
com.google.errorprone/error_prone_annotations 2.3.4
com.datomic/client-api 0.8.54
com.google.guava/listenablefuture 9999.0-empty-to-avoid-conflict-with-guava
com.datomic/client 0.8.111
com.cognitect/http-client 0.1.105
org.eclipse.jetty/jetty-client 9.4.27.v20200227
org.checkerframework/checker-compat-qual 2.5.5
com.google.guava/failureaccess 1.0.1
com.google.guava/guava 28.2-android
com.datomic/client-impl-shared 0.8.80
com.cognitect/hmac-authn 0.1.195
com.google.j2objc/j2objc-annotations 1.3
com.datomic/query-support 0.8.27
org.fressian/fressian 0.6.5
com.google.code.findbugs/jsr305 3.0.2
org.ow2.asm/asm-all 4.2#2020-08-1415:44kennySwitching the Clojure Deps setting to "Use tools.deps" directly with 0.9.763 selected and restarting IntelliJ fixes the issue. Seems like there's some sort of bug in the most recent Clojure CLI + Cursive.#2020-08-1522:47cfleming@U083D6HK9 If you manually refresh your project using the button in the deps toolwindow, does that fix that problem using the deps CLI?#2020-08-1600:55kennyNo. #2020-08-1604:54cflemingI spent some time looking at this, I can’t reproduce it and nor do I have a plausible explanation for how it might occur. I created this test repo, could you try it and see if it reproduces the problem for you? https://github.com/cursive-ide/deps-problem-repro#2020-08-1618:52kennyOkay I have a smaller repro here: https://github.com/kennyjwilli/deps-problem-repro. For whatever reason, if I remove any other deps from the deps.edn, the call will succeed. I added an example namespace with a single call in a comment block. A "successful" call will look like this:
(d/client {:endpoint "",
:server-type :ion,
:region "",
:system "",})
2020-08-16 11:49:43.136:INFO::main: Logging initialized @22704ms to org.eclipse.jetty.util.log.StdErrLog
Execution error (ExceptionInfo) at datomic.client.impl.cloud/parse-endpoint (cloud.clj:75).
Invalid endpoint
A failed call will look like this.
(d/client {:endpoint "",
:server-type :ion,
:region "",
:system "",})
Syntax error (FileNotFoundException) compiling at (datomic/client/impl/shared.clj:1:1).
Could not locate cognitect/hmac_authn__init.class, cognitect/hmac_authn.clj or cognitect/hmac_authn.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
When running the REPL with "Run with IntelliJ project classpath" and the test alias checked, I will get a failed call. When running the same call in a terminal started via the REPL I get a successful call.
clojure -A:test
Clojure 1.10.1
user=> (require 'example)
nil
user=> (in-ns 'example)
#object[clojure.lang.Namespace 0x218e28d9 "example"]
example=> (d/client {:endpoint "",
:server-type :ion,
:region "",
:system "",})
2020-08-16 11:49:43.136:INFO::main: Logging initialized @22704ms to org.eclipse.jetty.util.log.StdErrLog
Execution error (ExceptionInfo) at datomic.client.impl.cloud/parse-endpoint (cloud.clj:75).
Invalid endpoint#2020-08-1618:54kennyI did notice that when calling clj -Stree -A:test, the hmac-authn dep comes from dev-local. In Cursive's dependency tree in Clojure Deps, it comes from client-cloud.#2020-08-1618:54kennyBoth are the same version so I wouldn't expect a different behavior.#2020-08-1415:54Alex Miller (Clojure team)there was a dependency bug related to this scenario in tools.deps / clj#2020-08-1415:55Alex Miller (Clojure team)that was fixed in tools.deps 0.8.709 / clj 1.10.1.561#2020-08-1415:57Alex Miller (Clojure team)the bug here relates to having the same dep being included via two dependency paths where it's excluded in one and included in another (was previously somewhat arbitrary which branch you encountered first whether you'd get it). as of those versions above, you should always get it.#2020-08-1415:57kennyOh, so I assume Cursive needs to make some change to work correctly with the fix?#2020-08-1415:59Alex Miller (Clojure team)not sure what happens in the nrepl case in intelllij#2020-08-1415:59Alex Miller (Clojure team)running it as a deps project with system clj should work based on what you have#2020-08-1416:00Alex Miller (Clojure team)intellij has been updated in the version you have to cover recent changes in clj#2020-08-1416:00kennyAh, selecting "Run with Deps" in the run config?#2020-08-1416:00Alex Miller (Clojure team)yeah#2020-08-1416:01Alex Miller (Clojure team)re "the IntelliJ project classpath" - I think that's an independent thing sourced from your deps, not sure I understand exactly how it's managed#2020-08-1522:54cflemingBasically, when you sync a project to IntelliJ, it adds all the deps to the project and indexes them. That’s what you see under “External Libraries” in the project view, or in more detail under File->Project Structure->Modules-><some module>->Dependencies.#2020-08-1522:55cflemingRun with IntelliJ project classpath just uses those deps as well as the source roots etc to make the classpath. In a deps project, this should be the same as using Run with Deps, with the caveat that you’re implicitly using the aliases which were used to sync the project.#2020-08-1416:03kennyEach time I start a REPL with the "Run with Deps" option, Cursive will run a "Calculating Classpath" step that takes a solid 5s or so. The IntelliJ project classpath appears to use some sort of caching to avoid that step.#2020-08-1416:04kenny"Run with Deps" also does not encounter the problem.#2020-08-1416:04Alex Miller (Clojure team)you are past my level of knowledge on the calculating thing#2020-08-1416:05kennyIt sounds like whatever machinery IntelliJ project classpath uses requires some sort of change to work correctly with the latest cli version.#2020-08-1416:06Alex Miller (Clojure team)don't know, that's a question for Colin. of course it's like 4 am Sat morning his time so he's probably won't see this for a bit :)#2020-08-1416:07kennyThe Run with Deps option fixes my problem so I'll use that. Thanks 🙂#2020-08-1416:16kennyActually, that's not true. I didn't add any aliases to my "Run with Deps" selection. After adding in the alias that has dev-local, I get the same FileNotFound exception.#2020-08-1416:20kennyThe only method that works is selecting "Use tools.deps directly".#2020-08-1416:24Alex Miller (Clojure team)that doesn't make sense to me, as I would expect using clj 1.10.1.561 to work#2020-08-1416:26kennyI would agree. Directly using the CLI works as expected.#2020-08-1417:19marciolHi @cfleming, I’m wondering if it’s possible to add some niceties in the cursive REPL, such as a way to fold and unfold large EDNs, and to add some kind of scrolling to exceptions. I suspect that this is not so easy to do given the Intellij constraints, but it’d be nice to know at first hand.#2020-08-1522:57cflemingThe folding of large EDNs might be possible (I assume you’re talking about eval results, right?) and I have some plans along those lines. I’m not sure what you mean by “scrolling to exceptions” - can you elaborate?#2020-08-1417:42Alex Miller (Clojure team)there are some options under Preferences -> Languages & Frameworks -> Clojure like "Prettify stacktrace elements using folding" - did you try that?#2020-08-1417:49frozenlockHello,
I have some co-workers using Cursive and apparently the static analysis doesn't work with modified defn forms.
Is it something that can be configured?
(defn-spec my-inc
:args any?
:ret any?
[x]
(inc x))
#2020-08-1523:00cflemingSort of. If your macro can be made to look like one of the built-in ones, then you can tell Cursive to treat it as the built-in like this: https://cursive-ide.com/userguide/macros.html#customising-symbol-resolution#2020-08-1523:01cflemingYour example there won’t work, because defn doesn’t accept forms before the arglist. However, see https://github.com/gnl/ghostwheel for an example of how that macro might look to be able to work with Cursive.#2020-08-1615:49frozenlockAh I see. It's unfortunate it cannot work with the current form, but thank you for providing the ghostwheel example.#2020-08-1417:57marciolNice @alexmiller#2020-08-1423:25Pavel KlavíkHi, I am getting the following error in Shadow-cljs when evaluating a string with UTF-8 characters in nREPL:
#2020-08-1423:25Pavel KlavíkException in thread "XNIO-1 I/O-3" java.lang.RuntimeException: com.fasterxml.jackson.core.JsonParseException: Invalid UTF-8 start byte 0xf8
at [Source:
#2020-08-1423:25Pavel KlavíkIf I evaluate it from REPL in terminal, everything works fine.#2020-08-1423:25Pavel KlavíkAny idea what could be causing this?#2020-08-1521:21Nick Cernis[SOLVED: thanks to salam for the help!] Should Cursive automatically load and run the Clojure hello world project from http://exercism.io without additional setup?
If I “Run tests in current NS in REPL” from hello_world_test.clj I see Could not locate hello_world__init.class, hello_world.clj or hello_world.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name. (The docs suggest Cursive should load any dependent namespaces, and the hello-world-test ns requires the hello-world namespace.)
If I send hello_world.clj to the REPL and then “run tests in current NS in REPL” from the test file I see Running tests in hello-world-test but tests never appear to complete and the forms are not annotated with test results as described in the https://cursive-ide.com/userguide/testing.html.
Running lein test produces results as expected but obviously does not offer editor integration.#2020-08-1521:36salamwhat’s the classpath you chose in the run configuration to start the repl?#2020-08-1521:49Nick CernisThere was no option to select a classpath. I just picked “Start IDE repl” from the Tools menu.#2020-08-1521:52salam“IDE repl” in Tools menu? i’m not sure what that is and how it’s configured.#2020-08-1521:52Nick Cernis#2020-08-1521:54salamyeah, ~that might be something excercism-specific.~#2020-08-1521:54salamcan you try running the repl using a regular run configuration?#2020-08-1521:55salamControl + Option + R and Edit Run Configurations.#2020-08-1521:59Nick CernisIt works! Thank you so much, that has been a big help.#2020-08-1522:00Nick CernisIt looks like there is a difference between an “IDE: User” REPL (which Tools → Start IDE REPL generates) and a “Local: User” REPL (which the run configuration starts). I'll dig into the Cursive docs to learn more…#2020-08-1522:25cflemingThe IDE REPL isn’t documented - you need to have a property (`idea.is.internal=true`) set in order to see it. It opens a REPL on your open IDE instance, which is a totally different environment to your project. It’s mostly useful for me, at least at this stage.#2020-08-1616:19Nick CernisAh, thank you @U0567Q30W — that explains it. I have the internal flag set to true for my own theme/plugin development and didn't realise it affected Cursive in that way.#2020-08-1607:46p-himikIs there any way to disable the prompt to convert pasted HTML into Hiccup?#2020-08-1823:35cflemingThere isn’t, but I’ll add one.#2020-08-1823:37cfleminghttps://github.com/cursive-ide/cursive/issues/2416#2020-08-1623:16Mr. SavyI'm getting a "cannot be resolved" for all function names in Intellij.
I saw that there was a recent conversation about this. Would that be the one to refer to or is there a more general troubleshooting suggestion to try first? I suspect the namespaces aren't being imported correctly, but I'm not really sure.#2020-08-1823:44cflemingThere are a few things to check here. This is usually that the project hasn’t synced correctly. Are you using deps/lein to manage your project? If so, check the relevant toolwindow and make sure that your project is correctly registered there. If it’s not, then in the project view, right click on the project.clj/deps.edn and select add as lein/deps project.#2020-08-1823:45cflemingIf it is, then check that your module has dependencies - go to File -> Project Structure -> <your module> -> Dependencies and make sure that looks roughly like you expect.#2020-08-1823:45cflemingIf you’re getting it for all symbols and not just your Java interop then it’s probably not your SDK.#2020-08-1823:46cflemingFailing all that, you can also try File -> Invalidate Indexes and Restart, since sometimes the indexes can get funky.#2020-08-1708:47mhuebertIs there any way to customize the indentation of host interop forms like this? I’d like them all to be “indent”, otherwise when doing interop, forms tend to grow far to the right#2020-08-1823:38cflemingHmm, no, there isn’t. Would you like this for all interop forms across the board, or for specific calls?#2020-08-2409:46mhuebertI’d do it across the board#2020-08-1714:57reefersleepI’m experimenting with getting a single source of truth for env vars for my Clojure project.
Struggling with keeping secrets secret 🙂
Using the an .env file for env vars, EnvFile for loading that file into my Cursive project, and direnv for automatically loading in the .env file via a .envrc proxy whenever I cd into my project in the terminal, I can get most of the way; the .env file is a single source of truth for both Cursive and the terminal.
However, I’d like to avoid storing secrets directly in my .env file, as I might accidentally commit those to the project repo. And the .env file is pretty much just a key-value store, so I can’t do scripting in it like pull-this-key-from-my-secrets-store (where secrets-store is pass, or lastpass, or (on mac) security or what have you).#2020-08-1714:57reefersleepAnyone know of a good solution for what I’m talking about?#2020-08-1715:05reefersleepPerhaps it’s really simple and readily available, like running a .sh script just before starting my REPL or whatever.#2020-08-1715:17kenny> I might accidentally commit those to the project repo
@reefersleep Sounds like you should gitignore that file.#2020-08-1715:23reefersleepThat’s one solution, but I feel it isn’t strong enough. I’d like to keep secrets completely out of the lexical scope of the project.#2020-08-1715:24reefersleepIf I keep them in something like pass, they’ll be encrypted as well, not available in plaintext.#2020-08-1715:56Alex Miller (Clojure team)https://github.com/awslabs/git-secrets#2020-08-1716:06reefersleepCheers both @U064X3EF3 and @U083D6HK9. I feel that both utilising .gitignore and git-secrets are additions that one can make to prevent leakage of secrets - and there’s nothing against using these things in the project while also keeping your secrets in an encrypted store.#2020-08-1716:06reefersleepI just want to be able to get them out of the store and into IntelliJ somehow 🙂#2020-08-1717:21jdhollisNot necessarily intended for local development (though there’s nothing preventing it): https://www.vaultproject.io#2020-08-1717:24jdhollisRails has a more file-oriented approach: https://edgeguides.rubyonrails.org/security.html#environmental-security#2020-08-1717:25jdhollisBut you’ll still need to store the key somewhere.#2020-08-1723:31rutledgepaulvhttps://github.com/mozilla/sops is one way of keeping secrets in your git repo but secure. I've used this so I can manage secrets "in-band" with the rest of my changes, then decrypt them on the deploy agent and push them to wherever they need to go (like a k8s secret). I use AWS KMS keys so the key is nowhere on my machine (just some temporary credentials for AWS that expire every few hours)#2020-08-1723:34rutledgepaulv.gitattributes filters for check-in and check-out are useful too. I've wired those up with sops (above) so that locally my file always appears plaintext but when I check it into git it gets encrypted automatically so there's never a plaintext version in the remote. I was initially inspired by https://oteemo.com/2019/06/20/hashicorp-vault-is-overhyped-and-mozilla-sops-with-kms-and-git-is-massively-underrated/#2020-08-1812:19reefersleepThanks a bunch @U5RCSJ6BB and @U7JK67T3N! Lots of reading material 🙂#2020-08-1800:15jI'm using cursive on windows, and when I try to add a Run Configuration for a local REPL, I get Run Configuration Error: No modules containing clojure.main found . I checked under File | Settings | Build, Execution, Deployment | Build Tools | Clojure Deps and made sure that I was using tools.deps directly with the latest version.#2020-08-1823:47cflemingThis usually means that your project hasn’t synced correctly, try the steps detailed here: https://clojurians.slack.com/archives/C0744GXCJ/p1597794253112900?thread_ts=1597619780.089600&cid=C0744GXCJ#2020-08-1821:25luiseugenioIs anybody having trouble with Cursive when loading any namespace (MacOs Catalina 10.15.6)? I get this error:
Execution error (ConnectException) at java.net.PlainSocketImpl/socketConnect (PlainSocketImpl.java:-2).
Operation timed out
Regards#2020-08-1822:06luiseugenioSOLVED. Nevermind, It was a (slurp to get an aws ip address) that last too much and timed out the loading process.#2020-08-1821:53jaimeHi, does cursive support resolving/autocomplete of methods in third party JS library? I'm using shadow-cljs and d3.js , most of the methods in the d3 object are showing "cannot be resolved"#2020-08-1823:47cflemingIt doesn’t right now, but I would like to fix that soon.#2020-08-1903:54Oliver GeorgeQuick sanity check. I updated IntelliJ and seems like Cursive isn't working.
IntelliJ IDEA 2020.2 (Community Edition)
Build #IC-202.6397.94, built on July 27, 2020
Non-Bundled Plugins: String Manipulation, com.intellij.plugins.watcher, name.kropp.intellij.makefile, net.seesharpsoft.intellij.plugins.csv, com.cursiveclojure.cursive, PythonCore#2020-08-1903:56cflemingLooks ok to me, I’m using Cursive on 2020.2 and lots of others are too. What’s not working?#2020-08-1903:57Oliver George#2020-08-1903:57Oliver GeorgePerhaps my project isn't configured right. I'll poke around more.#2020-08-1903:58Oliver GeorgeThanks for confirming it should work.#2020-08-1903:58cflemingIf this is a project that was working previously, the first thing to try would be File->Invalidate caches and restart - indexes can get funky after upgrades.#2020-08-1903:59Oliver GeorgeFound the problem. My fault. I'd rebuilt the project but not enabled a required deps alias.#2020-08-1904:00Oliver GeorgeReason isn't interesting but it's react native and I'm switching between figwheel and krell... both have different clojurescript deps so I don't specify it as a top level dep.#2020-08-1904:00Oliver GeorgeAnyway, my bad.#2020-08-1903:54Oliver GeorgeShould I downgrade IntelliJ?#2020-08-1904:02Oliver George@cfleming while you're about. It'd be really nice if js interop stuff wasn't all marked as "not resolved"...#2020-08-1904:04cflemingYeah, I was actually planning to start fixing that this afternoon - it’s on my shortlist.#2020-08-1904:04Oliver GeorgeAwesome.#2020-08-1904:04Oliver GeorgeSame for core js stuff like promises...#2020-08-1904:04Oliver George#2020-08-1904:22bedersI'm getting Dependency errors when using [day8.re-frame/tracing "0.5.1"].
When loading a namespace, Cursive displays: "Dependency cycle. trace.cljc -> trace.cljc -> trace.cljc"#2020-08-1904:22bedersany way around that other than not using this library?#2020-08-1904:24beders(this is with old fighweel using piggy back and whatnot)#2020-08-1905:20stuartrexkingCan anyone remind me which setting is responsible for wrapping on indenting? Say I have
(comment)
(println "HELLO")
if I indent the second line I want it to automatically wrap like so
(comment
(println "HELLO"))
#2020-08-1920:27misha#2020-08-1905:22stuartrexkingI've had to setup on ubuntu as my MBP battery exploded and I lost my settings 😢. I can't remember what configuration I had exactly.#2020-08-1905:44stuartrexkingThis is what it does with the default settings. I can't tell if it's IdeaVim not playing nicely or Cursive config.#2020-08-1906:19stuartrexkingLooks like what I actually want is parinfer.#2020-08-1906:25stuartrexking🤐#2020-08-2006:57mishacan anyone point me to "the latest clojure-script repl in cursive how-to" or something? (with deps and shadow-cljs preferably)#2020-08-2006:59mishaI find myself spending too much time trying to split code into cljs/cljc just to be able to send it into clojure repl to check/test things. but it kills prototyping speed because I have way too many points of integration with js#2020-08-2007:00mishaso I figured, that just setting up "send to cljs repl" would save me tons of time#2020-08-2007:52mishahttps://gist.github.com/akovantsev/44e2a0e10908785d1f40d3d3bcfff574#2020-08-2016:51jdhollisThe only tweak I would make is to use the generated .nrepl-port file.#2020-08-2018:45mishayeah, shadow-cljs doc mentions that, but I don't have it in earlier cursive version. I updated gist.#2020-08-2108:03JoniIs there some issue with idea resolving dependencies installed locally? Trying to use datomic local dev library which is not available for distribution, but is installed locally mvn -q org.apache.maven.plugins:maven-install-plugin:3.0.0-M1:install-file -Dfile=dev-local-0.9.195/dev-local-0.9.195.jar but idea/cursive can't resolve so I can't start a repl with com.datomic/dev-local {:mvn/version "0.9.195"} in deps#2020-08-2108:27cflemingNo, there shouldn’t be a problem with that. Can you check that ~/.m2/repository/com/datomic/dev-local/dev-local-0.9.195.jar exists?#2020-08-2108:29Joniit's in
~/.m2/repository/com/datomic/dev-local/0.9.195/dev-local-0.9.195.jar#2020-08-2108:30cflemingAh, yes, right. What’s the error that you receive?#2020-08-2108:30cflemingYou don’t have your local repo customised, right?#2020-08-2108:32JoniErrors during project resolution
The following errors were found during project resolve:
/Users/joni.korpelin/projects/****/app/backend/deps.edn:
Could not find artifact com.datomic:dev-local:jar:0.9.195 in central ()
#2020-08-2108:34Jonirunning the repl works fine with clj cli tool. I don't think I have customised local repo in any meaningful way#2020-08-2503:11cfleming@UMBC73RK9 Is this still a problem for you? I just got around to trying to reproduce this and I can’t - I’ve followed the above steps and it works fine for me.#2020-08-2505:40JoniNo it's not, and sorry for not getting back to you before. I assumed dependencies were fetched on Idea restart because it threw the error then, but didn't resolve it after I did the install locally. Did another change to deps and it worked.#2020-08-2305:14dangercoderIs it possible to hide private vars from auto-completion?#2020-08-2323:57cflemingIt’s not at the moment, no.#2020-08-2408:58ikitommiI imported a shared (deps-based, via :local/root) library as a module into an existsing deps-project. It seems that the paths are not resolved correctly for that module if the paths are defined under a alias, e.g.
{:aliases {:backend {:extra-paths ["src/clj"]}}}
If I put all the paths into top :paths it works correctly.
{:paths ["src/clj" "resources"]}
How can I work with deps-modules with paths under aliases?#2020-08-2410:59cflemingThis should do it: https://cursive-ide.com/userguide/deps.html#working-with-aliases#2020-08-2414:17ikitommiCan’t figure out how to do that. In the Deps section I can see both modules, but only 1 set of aliases, which are from the main project. I don’t know how to enable :dev profile just for the added module.#2020-08-2414:18ikitommiDeps looks like (`common`) is the module I imported, need to apply it’s :dev alias.#2020-08-2414:19ikitommisetting the paths to top-level resolved the issue:#2020-08-2414:20ikitommithis fails:#2020-08-2414:20ikitommiwith this:#2020-08-2414:21ikitommiand the actual the code is under src/clj.#2020-08-2414:23ikitommiresolved: removing the src from sources makes it work. so, having src at top-level and src/clj under alias made it to fail.#2020-08-2500:43cflemingOh, so the problem is that src was present, but is not the actual source root - is that right? You don’t have code directly under src?#2020-08-2503:59ikitommino code directly under src directly, just subfolders clj, cljc and cljs with the actual sources.#2020-08-2409:22ConorI'm having some trouble refreshing deps-based projects using Cursive - the error I get is 'Command failed when executing /usr/local/bin/clojure'. Going in to the settings, I can see it's pointing to that path but it seems like it can't correctly pick up the clojure executable there as it also has 'Command failed' just under it rather than the clojure version. I can run clojure using the terminal - what am I missing here?#2020-08-2411:01cflemingDo you have anything in your log saying Output from <command> where command is probably /usr/local/bin/clojure? Help->Show log in Finder/Explorer/whatever#2020-08-2411:04Conor#cursive.deps.DepsSettings - Output from /usr/local/bin/clojure -Sdescribe: Couldn't find 'java'. Please set JAVA_HOME.
#2020-08-2411:06ConorOddly, I can now use Clojure directly and it appears to work OK#2020-08-2411:11cflemingDo you mean use tools.deps directly?#2020-08-2411:12ConorNo, I switched to that temporarily, which worked. I mean that I can select the 'Use CLI tools' radio button and it now doesn't display the error#2020-08-2411:13cflemingThat is super weird, but I’ll take it 🙂#2020-08-2411:15ConorI did a bunch of different things (installed tools.deps, installed lein via apt, restarted IntelliJ), so not sure which one was the winner. At least it works! 😄#2020-08-2607:52mokrHi, does anyone know if the keyword navigation changed in one of the latest versions?
I used to be able to find usages of my re-frame subscriptions and events (namespaced keywords), by CMD-clicking or using OPT-F7 (“Find usages”). In the latest version it seems to interpret the namespace of the keyword literally so that “Find usages” only searches that namespace in addition to the current file.
Example: namespace x.y have (reg-sub :foo/bar …) previously I would be able to find all places this subscription was used, but now it will only show me usages in ns “x.y” or “foo”.
Is the old behaviour available behind some setting, perhaps?
PS: I actually started using namespace keywords when I found that it allowed that kind of navigation while regular keywords didn’t.
(Specs: IntelliJ 2020.2 CE, Cursive 1.9.3-2020.2, MacOS 10.15.6)
EDIT:
Maybe I got confused by a change in the popup or something. “Find usages” now asks which of the two namespaces I would like to search, but the selection does not seem to have any effect, as it search all anyway. What I’m hoping for is to see usages directly in that popup as that gives a much smoother experience than going via a listing in the “3:Find” panel.#2020-08-2700:47cflemingThat sounds very strange. Can you post a screenshot of the find usages panel with the results of a problematic search?#2020-08-2700:48cflemingIn particular I’m interested in the summary that says “Usages of <something> in <some scope>” - what does <some scope> look like?#2020-08-2614:58imreHey @cfleming, has anyone ever requested a feature to highlight unneeded type hints? I find the missing type hint highlighting quite useful#2020-08-2700:49cflemingYes, I’ve thought about this, as well as related things like moving multiple type hints from usages to the declaration (e.g. if a parameter has type hints on 3 of its usages, you could remove them all and type hint the parameter itself).#2020-08-2700:50cflemingBut it’s surprisingly tricky. Here’s an example:
(let [x ^List some-thing
y x]
(.iterator y))#2020-08-2700:52cflemingHere the type hint on x is required because later it’s used after being implicitly passed to y. However if y never used interop forms, that would not be required.#2020-08-2700:52cflemingI haven’t sat down to think through all the corner cases, but I suspect it’s a long list 🙂#2020-08-2717:11imreI'm sure about that, thanks for the insight#2020-08-2615:41isakYou know the feature where you type something like (rf/dispatch ...), but you have no rf alias in your :require , and Cursive automatically adds or suggests it for you? I'm having a problem where it doesn't work for one namespace aliasing: [lambdaisland.glogi :as log]. Any ideas?#2020-08-2700:59cflemingNo, I can’t see why that wouldn’t work - I just tried to repro and it works fine here.#2020-08-2700:59cflemingCan you create a small reproduction project and put it on github so I can try it?#2020-08-2714:49isak@cfleming Sure, here it is: https://github.com/isaksky/cursive-ns-test (for me :require assist does not work in db.cljs), it just looks like this:#2020-08-2807:44svtHello
IntelliJ with Cursive
I want to setup debugger for my clojure code using ring-server what is the good way to setup it.
Could someone please help me on this?#2020-08-3018:00mishawhat is the latest "stabler" idea+cursive version?
I've been on 2018.2 for a while after some issues last year. Now I got a minute to update opieop#2020-08-3019:12salami haven’t experienced anything major other than annoying (but seemingly benign) exceptions from Cursive with IntelliJ IDEA 2020.2.1 + Cursive 1.9.3-2020.2#2020-09-0110:40cflemingYes, the latest stable versions of both should be fine AFAIK.#2020-09-0110:39Jakub Holý (HolyJak)@cfleming Perhaps mention on https://cursive-ide.com/userguide/testing.html the trick to resolve with-test as do so that the function usages are not marked as "unresolved"?#2020-09-0110:41cflemingActually, what I should do is just add proper support for with-test so you don’t have to hack it.#2020-09-0110:44cflemingAmazingly, I don’t seem to have an issue for that: https://github.com/cursive-ide/cursive/issues/2423#2020-09-0110:48conanHiya, I'm getting an error Deferred parameters have not been cached! whenever I try to restart my REPL. It seems as though this https://github.com/cursive-ide/cursive/issues/2308 has previously been raised and closed, is there a known fix or should i reopen the issue?
Cursive 1.9.3-2020.2, Intellij Ultimate 2020.2#2020-09-0110:49cflemingCould you file a new issue linking the old one, with some repro instructions?#2020-09-0110:54conanwill do#2020-09-0714:08conani haven't been able to figure out a small reproduction, sorry#2020-09-0714:08conanhappens every time though, only on restart never on stop/start#2020-09-0719:55cflemingOk, I’ll see if I can repro trying that.#2020-09-0205:27cfleminghttps://twitter.com/CursiveIDE/status/1301028728244330496#2020-09-0205:28cfleming@U2FRKM4TW This contains the switch to turn off hiccup conversion you asked about.#2020-09-0205:31p-himikAwesome, thanks!#2020-09-0206:32Nick CernisThank you for Cursive. I bought a licence and really like it.
Does Cursive accept bounties via https://www.bountysource.com/ or similar?
Some issues I'd be willing to put money towards if it helped to prioritise their development:
• Inline form evaluation (this is my most-missed feature from other editors): https://github.com/cursive-ide/cursive/issues/391
• Shadow CLJS support: https://github.com/cursive-ide/cursive/issues/1804
• Test runner: https://github.com/cursive-ide/cursive/issues/247#2020-09-0221:40cflemingHi Nick, thanks for the kind words, I’m glad you’re liking Cursive! There’s no bounties for Cursive, simply because money isn’t the limiting factor, my time is. However those three issues are on my shortlist to get fixed ASAP, so I hope they’ll be there soon.#2020-09-0215:36potetm@cfleming After updating this morning, I’m not getting colorization/formatting on some REPL evaluations.#2020-09-0215:36potetmI can’t quite figure out what the pattern is.#2020-09-0215:37borkdude@cfleming Does Cursive have a similar thing to this? https://github.com/borkdude/clj-kondo/issues/872#issuecomment-685781515#2020-09-0221:28cflemingIt doesn’t, but it should. There’s some debate about what they should look like too, since not all forms accept metadata. Possibly something like #_:no-unused-symbol before the form for those cases.#2020-09-0221:28borkdude@cfleming That's exactly the discussion I'm having in that issue. Maybe we could come up with a common format#2020-09-0221:29borkdudeInstead of the uneval (which also came along in the issue) I've also proposed:
^{:clj-kondo/ignore-nth 1} (foo "bar" (baz ...))#2020-09-0221:32cflemingOk, I’ll think about it - I’ve actually just been adding some inspections and missed being able to disable them. I’ll check what IntelliJ provides/requires for this as well, since that may limit my possible solutions.#2020-09-0215:39potetmWait I think I found it#2020-09-0215:40potetmYeah, there was a key in the response that started with an @#2020-09-0215:41potetmpretty printer didn’t like it#2020-09-0221:24cflemingInteresting, what did those look like? I can have a go at fixing that.#2020-09-0221:25potetmIt was an invalid keyword: :@timestamp#2020-09-0221:25potetmIt plain-printed the response form.#2020-09-0221:25potetmNo colorization, no indentation.#2020-09-0221:26potetmtbh it made sense once I figured out what was up#2020-09-0221:26potetmBut I updated the EAP today, and Jumped To Conclusions!™#2020-09-0221:28cflemingAh, I see - yes, unreadable keywords can cause interesting issues 🙂#2020-09-0221:57potetmI was once on a crusade to un-keywordize all json. Sheer momentum put a stop to it, and now I, for one, welcome the pile of unnecessary errors I will live with forever and ever amen.#2020-09-0223:12cfleming:hail_mary:#2020-09-0215:41potetmall good here, ty#2020-09-0319:22jmvhow do i switch my license type over? i used cursive a while back with the non-commercial license but now i'm able to use clojure professionally so i bought the personal license.#2020-09-0321:46cflemingThanks! You can always register a new licence at Help | Register Cursive…#2020-09-0400:43jmvthanks!#2020-09-0319:35chrisulloaIs there a Cursive/IntelliJ way of deleting a function across an entire project?#2020-09-0321:47cflemingHmm, no, I don’t think there’s anything like that, sorry.#2020-09-0322:12chrisulloaThanks for confirming, ended up doing it with some vim regex commands#2020-09-0319:35chrisulloa(foo/some-fn val) -> val#2020-09-0320:44octahedrionone thing I'd like for Cursive to have is for each new REPL to have an easy way to communicate with all the existing open REPLs. Yes, I can do (require '[nrepl.core :as nrepl]) and then eval forms given the right port numbers but I want it all configured for me by default#2020-09-0321:47cflemingInteresting idea, what’s your use case?#2020-09-0322:06octahedriongeneral everyday REPL use - often I'm working in one REPL, then I open another and find I want to get something I'd computed in the other REPL#2020-09-0322:09octahedrionI want to be able to refer to all the open REPLs like namespaces#2020-09-0322:11octahedrionlike repls/0/user/x would refer to var x in the user namespace of the first REPL#2020-09-0322:11octahedrionsomething like that#2020-09-0322:11octahedrionor have a fn like ns-map repl-map that would return all the information in all the repls#2020-09-0420:54thhellerhmm what could I have done that made the cursive auto-require intent not show up anymore? it used to work but now it just doesn't appear ever?#2020-09-0509:18cflemingThis changed in the latest EAP so it’s possible something broke. First up, did you disable any of the new inspections? If not, can you email me your log file and I’ll take a look?#2020-09-0610:03thhellerhmmm I think I disabled something but not exactly sure what#2020-09-0610:04thhellerthe thing that used to show up in the top right corner of the editor window showing warning/errors numbers in the file is gone somehow#2020-09-0610:04thhellerdon't know what its called but maybe its related#2020-09-0610:04thhellerinspection I disabled for undeclared var stuff since half my files are yellow all over 😛#2020-09-0610:08thhellerah thats actually it. turned it into a "weak warning" and now I have the auto-require thing back without the visual noise#2020-09-0610:08thhellerthx for the hint. didn't think those were related.#2020-09-0610:51katoxIn the latest EAP it does the opposite for me (in the REPL and during debugging, like alt-F8 eval expr). If I confirm the bubble in the REPL cursive spits out the require just to present the same bubble again every time. But it is not really needed it works even though it shows an underlined unresolved symbol.#2020-09-0621:47cfleming@U05224H0W They weren’t until the latest EAP. I broke some of that out into inspections which means that users can control them better. There seem to be some performance issues doing that though so that may go backwards.#2020-09-0621:48cfleming@U0KD0N5T5 I’ll look into that, thanks.#2020-09-0720:23dazldDid something break in the latest EAP builds to do with protocols? I’m getting some very weird behaviour now (`1.9.4-eap3-2020.2` ) - namely cursive tries to import protocols instead of requiring them.#2020-09-0720:23kennyI've seen this too.#2020-09-0720:26dazldgetting some code warnings on valid destructuring of a method arg too#2020-09-0720:29dazldgoing to downgrade to 1.9.3#2020-09-0720:40dazldthis is valid, right?#2020-09-0720:40dazldthe :or clause, specifically#2020-09-0720:42kennyYes#2020-09-0720:42dazldwell, that’s a bug in 1.9.3 as well then, and the import behaviour happens there too#2020-09-0720:43dazldthank for sanity check @U083D6HK9#2020-09-0720:54cflemingThanks for the report, I’ll check those cases out.#2020-09-0721:41cflemingWith the protocol issue, what does the protocol reference look like in your code when Cursive is trying to import it?#2020-09-0721:43cflemingThere’s actually an additional problem where Cursive tries to resolve the symbol at the protocol definition itself, I think that’s an IntelliJ 2020 problem.#2020-09-0721:45kenny#2020-09-0721:46kennyIt seems to only happen in some namespaces.#2020-09-0721:46kennyThat namespace is .clj#2020-09-0721:47kennyDoesn't appear to happen in the 3 cljs namespaces I tested (though, they're all from the same IntelliJ module)#2020-09-0721:47cflemingRight, that’s at the definition - that I think is new in IntelliJ 2020, I had to fix a bunch of similar cases for vars.#2020-09-0721:48cflemingHmm, yeah, protocols are treated differently by Cursive in clj and cljs, since in clj they create an interface and in cljs they’re more like a var.#2020-09-0721:48cflemingI got the impression that @U3ZUC5M0R was talking about referring to them from another namespace, though.#2020-09-0721:48kennyOh, okay. That's the issue I've had. Not sure if @U3ZUC5M0R's issue is different.#2020-09-0721:49cflemingI’ll fix that one now.#2020-09-0722:27kennyJust noticed this one too @U0567Q30W#2020-09-0722:28cflemingYeah, I think that’s all the same case. I’ve just fixed it, it is indeed new in the new EAP, I can’t blame IntelliJ 2020 for this one.#2020-09-0821:15dazldwhen cursive imports the protocol, it looks like:
(:import (foo.bar.baz ISomething))
#2020-09-0821:15dazldas if it was a java interface#2020-09-0821:16dazldeg:#2020-09-0821:18dazldhowever, when imported like this, intelliJ does provide gutter hints, which doesn’t happen with require#2020-09-0821:20dazldetc.#2020-09-0900:17cflemingSo in that case, you would normally either :require/`:refer` that protocol, or refer to it qualified with an alias, like component/Lifecycle. Protocols are tricky in Clojure because they actually do define an interface, and in this case it’s probably what you want, although there are probably subtleties there that I’m not aware of.#2020-09-0817:10Harish TellaHello all, does anyone here use Figwheel with IntelliJ (Cursive)?
This question is likely more IntelliJ-related than Cursive-related, but I thought this would be a good audience to ask.
When I save a file in IntelliJ, my running Figwheel instance does not do a hot-reload right away. I have to switch my focus to the browser or the Figwheel repl for the hot reload to happen. When saving a file in a different editor, VS Code for example, the hot-reload happens right after saving.
I think this has something to do with the virtual filesystem setup by IntelliJ. Something about saving a file in IntelliJ doesn’t alert other programs like normal. An other clue is when I execute the Reload All From Disk command inside IntelliJ, the hot-reload happens.
If anyone has a clue it would be a huge step towards front-end nirvana.#2020-09-0900:13cflemingThat should work. How are you saving the file in IntelliJ?#2020-09-0914:07Harish TellaOh you are brilliant. That one question solved it for me.
⌘-S was not bound to anything in IntelliJ. I just assumed it was. It must have auto-saved when I switched the focus off of IntelliJ.
After binding ⌘-S to Save All , everything works like it should.
Thank you so much. And thank you for Cursive. I really love it.#2020-09-0919:52cflemingGreat! I’m glad it’s working. And thanks for the kind words, I’m glad you’re liking Cursive!#2020-09-0817:15manutter51I have this in my core.cljs file:
(defn ^:after-load refresh-on-figwheel-reload
[]
(rf/dispatch [:globals/refresh-on-figwheel-reload]))
Do you have something like that?#2020-09-0817:19Harish TellaHey, yup mine is like this
(defn ^:after-load re-render []
(rdom/render [views/app] (dom/$ "app")))
#2020-09-0817:19Harish TellaJust re-rendering a reagent component to the dom.#2020-09-0817:20manutter51Hmm, seems like it should work then#2020-09-0817:21Harish TellaYeah, I think this part is good. But thank you all the same.
Your CLJS files refresh without taking focus off of IntelliJ?#2020-09-0817:21manutter51You might try the ^{:key ...} trick, sometimes React does some internal caching that causes it to hold on to old renderings.#2020-09-0817:23Harish TellaOk, I’ll give that a try.#2020-09-0817:23manutter51Generally I can’t see my browser while IntelliJ has the focus, because the browser and the IDE are both full-screen on the same monitor, but I’ve seen CLJS debug messages scroll by in the CLJS REPL, so I’m assuming so.#2020-09-0817:19manutter51My CLJS files do refresh, but it can take a bit of time to re-compile, plus even after the refresh happens, my UI doesn’t necessarily re-render until it notices a data change. I have the refresh-on-figwheel-reload event handler set up to increment a value in the app-db, and then in my main page render I have
(fn []
^{:key (str "figwheel-refresh-key-" @[:globals/figwheel-refresh-key])}
[:div.container
;; main page container
])#2020-09-0909:57heliosgenerating stubs seems to not work for me, i’ve copied the .idea folder from another computer (just changed one). could that be the reason? where are the stubs written? Example: the stubs for datomic#2020-09-0910:00heliosi’ve invalidated the cache and restarted, but to no avail, using intellij 2020.2 and latest EAP cursive#2020-09-0910:04heliosnevermind, it said that my JDK was misconfigured. once i did that generating stubs worked fine#2020-09-1013:11Jakub Holý (HolyJak)How is it possible that I def-ine a var in the REPL window but it is then undefined? My session:
*ns*
=> #object[clojure.lang.Namespace 0xfcdc79d "user"]
(def s1 "To work with module.rds-st2.module.rds.random_string.suffix its original")
=> #'user/s1
(re-find #"To work with (module[^ ]+)" s1)
Execution error (ClassCastException) at user/eval72482 (form-init11451571577345478644.clj:1).
class clojure.lang.Var$Unbound cannot be cast to class java.lang.CharSequence (clojure.lang.Var$Unbound is in unnamed module of loader 'app'; java.lang.CharSequence is in module java.base of loader 'bootstrap')
(re-find #"To work with (module[^ ]+)" user/s1)
Execution error (ClassCastException) at user/eval72486 (form-init11451571577345478644.clj:1).
class clojure.lang.Var$Unbound cannot be cast to class java.lang.CharSequence (clojure.lang.Var$Unbound is in unnamed module of loader 'app'; java.lang.CharSequence is in module java.base of loader 'bootstrap')
s1
=> "To work with module.rds-st2.module.rds.random_string.suffix its original"
user/s1
=> #object[clojure.lang.Var$Unbound 0x2363d6f "Unbound: #'user/s1"]
Update It seems it was Shadow-cljs' cljs REPL and the app has likely not been running anymore so that could perhaps explain it...#2020-09-1013:15manutter51That was definitely a weird one#2020-09-1014:16kennytiltonIs there any way for us to extend the Cursive editor? On of the great tricks I learned thanks to an old skool Lisper was a surprising mouse-copy command that at first seemed bizarre and then became pretty much how I edited, esp. when refactoring: https://github.com/vsedach/mouse-copy We leave the insertion point where we want to (in effect) paste some code, then control-click or alt-control-click what we want to copy. Utterly counterintuitive and utterly addictive. Cursive rocks, but I miss this! 🙂#2020-09-1100:04cflemingOk, I’m going to have a quick go at implementing this. When you say copy, does the original stay in place or get deleted?#2020-09-1100:04cflemingAnd I guess you’re talking about the sexp surrounding the point you click on, correct?#2020-09-1101:51cflemingOk, the mouse handling here is trickier than I expected. I’ll ask JetBrains how to best handle this.#2020-10-2901:15AJ JaroLet me know if there’s anything I can do to help with this#2020-10-2903:44cflemingIt looks like this has been broken again in 2020.2 due to platform changes.#2020-10-2908:26cfleminghttps://github.com/cursive-ide/cursive/issues/2457#2020-10-2910:19AJ JaroThanks for checking it out @U0567Q30W. I think there might be a similar problem with finding CLJC usages that are in CLJS namespaces but I haven't nailed the scenario down yet. I'll let you know when I figure it out in more detail#2020-10-2922:30cflemingThat’s possible, yeah - unfortunately the CLJC support needs a total re-vamp, the current impl is not very robust and violates some IntelliJ invariants.#2020-10-2319:26Michael WWhy does IDEA tell me it cannot resolve clojure.data.csv when the code works?
(ns com.repsrv.lib.csv
(:require
#?(:clj
[ :as io])
[clojure.data.csv :as csv]))
#?(:clj
(defn take-csv
"input path to file, output csv as coll of coll"
[filename]
(with-open [file (io/reader filename)]
(-> (slurp file)
(csv/read-csv)))))
IDEA says csv/read-csv can't be resolved. Am I missing something?#2020-10-2419:26Michael WThis was a problem with clojure deps, I had to update src paths and refresh on clojure deps tab for it to resolve correctly again.#2020-10-2508:29Jakub Holý (HolyJak)Isn't Cursive supposed to have this feature where I can type (obj. and get completion of methods available on the object? It doesn't work for me:#2020-10-2510:56simongrayYou need a space between f and the dot#2020-10-2511:11Jakub Holý (HolyJak)Thanks a lot!#2020-10-2520:49cflemingSomeone pointed out to me that that should really use the dot form (. f |) and transform it on completion, but that doesn’t work at the moment.#2020-10-2608:15simongray@U0567Q30W What’s the | for?#2020-10-2608:20Janne SauvalaIs | marking the cursor placement?#2020-10-2609:08cflemingYes, that’s right, | marks where the caret would be.#2020-10-2705:07JoelThe REPL isn't loading java classes from my maven project (multi-module). It gives an error when loading the java class as part of the import statement. The class is found in a dependency (as listed in the pom)
I am using nREPL with the radio button "use intellij class path"... Is there something more I need to do? I tried using a deps.edn, but couldn't figure out how to refer to the maven subproject.#2020-10-2707:38cflemingYes, IntelliJ classpath is what you want to use. A few things - is the module which you’re using for your run config one which has access to the class dependency?#2020-10-2707:39cflemingIf so, it’s worth checking that the dependency has actually been added correctly to the module you think it has - check that at File | Project Structure | Modules | <your module> | Dependencies#2020-10-2717:35Joelinterestingly the only dependencies listed there were clojure ones (eg. instaparse), i presume those are coming from the pom. I added the other module and that succeeded in the clj import highlighting properly, not grayed out now. However, even after restart of repl/intellij still doesn't understand import when trying to load file to repl. (?)
Thanks for help so far, this is pretty important to using clojure/cursive at work.#2020-10-2719:27Joeli reimported my maven project, and redid the REPL... yay, seems to work now!#2020-10-2717:50royalaidHey @cfleming, small QOL fix that would be great:
When generating a test for CLJS instead of :refering all can you just alias test or :refer a known set of useful vars? :refer :all isn’t valid in CLJS land.#2020-10-2722:21cflemingOops, my mistake, I’ll fix that. In the meantime you can edit the template yourself: Settings | Editor | File and Code Templates | CLJS Test NS. I’d be interested to know what you come up with.#2020-10-2818:13royalaid(ns $NS_NAME
(:require [cljs.test :refer [async deftest is testing use-fixtures]]
#if($TEST_SUBJECT_NS != "")[$TEST_SUBJECT_NS :as sut])#else)#end)
is what I will be using for the moment, not sure what the standard is for cljs.test :requires s#2020-10-3009:07simongrayIs there a way to bind a key combo to send a piece of code to the REPL? I am developing a pedestal web service and it’s becoming a bit tiresome to navigate to the Rich comment block where my (restart-server) call is every time I make some changes… :S#2020-10-3009:12cflemingYep: https://cursive-ide.com/userguide/repl.html#repl-commands#2020-10-3009:19simongrayAwesomesauce!#2020-10-3009:28simongrayThank you very much! Works perfect.#2020-10-3011:08danieroux@U4P4NREBY it should not be necessary to call (restart-server) in pedestal. This is our dev-server:
(defn- route-fn
"Use the deref of the namespace to get hot-reloaded namespaces."
[]
(route/expand-routes
(deref #'tech.matterindustries.titan.ion.api-gateway.service-handler/routes)))
(def interceptors
(-> service-handler/service
; Get ion provider out of there
(dissoc ::http/chain-provider)
; hot-reloaded-fn ftw!
(assoc ::http/routes route-fn)
(merge
{::http/type :jetty
::http/port 7001
::http/join? false})
(http/default-interceptors)
(http/dev-interceptors)))#2020-10-3011:11danierouxNow everytime the route is hit, whatever code that was eval’ed in the REPL will get executed#2020-10-3014:34simongray@U9E8C7QRJ Interesting. Can you explain a little how it works? I am currently working with something like
(defn start []
(http/start (http/create-server service-map)))
but I don’t see any servers started in your snippet so I’m unsure what to do with it…?#2020-11-0210:47danieroux@U4P4NREBY interceptors is the service-map in your start The important line that you need in your service map while developing, would be (assoc ::http/routes route-fn) .
That route-fn dynamically expands the routes on every call - so point it to your routes#2020-11-0211:00simongrayAh, I see. So #'tech.matterindustries.titan.ion.api-gateway.service-handler/routes is just a regular var that you’re deref’ing?#2020-11-0211:08danierouxYes, the app routing table#2020-11-0211:19simongrayOk. Thanks! I think I'm just not familiar with the syntax here. Never deref'ed a var before. Anyway, I guess it wouldn't work without the deref since yo made it this way. I'm just not sure why.#2020-10-3012:22roklenarcicI don’t know if this would be a cursive feature or nrepl feature, but how could I specify a snippet of code I want to run every time I reload a namespace while connected to REPL?#2020-10-3020:50Jakub Holý (HolyJak)Set an environment variable / system property when starting REPL, have top-level expression wrapped in (if my-env-var-is-set...)?#2020-10-3100:50roklenarcicI should have said reload any namespace instead of a namespace#2020-10-3112:33Adrian SmithDoes any one remember the setting to change the behaviour so when inserting a bracket the ending bracket is inserted at the end of the form in front of it rather than not moving at all?#2020-10-3112:38Adrian SmithFound it here: https://github.com/cursive-ide/cursive/issues/2432#2020-11-0211:55pezDoes anyone know of cljfmt settings that are somewhat compatible with Cursive defaults?#2020-11-0310:23cflemingI’ve never investigated this, but I’m interested in this too, it would be good to document.#2020-11-0310:33pezHow far from the https://github.com/bbatsov/clojure-style-guide#the-clojure-style-guide are the Cursive defaults? Not all that far, right? I see some difference in my day job project, but I am not sure what comes from Cursive settings and what is from its defaults (most people here use Cursive).#2020-11-0310:35pezThese are the settings one of my colleagues sent me:
<ClojureCodeStyleSettings>{
:cljs.core/as-> :only-indent
:cljs.core/case :only-indent
:cljs.core/defonce :only-indent
:clojure.core/case 2
:compojure.core/defroutes :only-indent
:cursive.formatting/align-binding-forms true
:cursive.formatting/comment-align-column 0
:garden.def/defstyles :only-indent
}</ClojureCodeStyleSettings>#2020-11-0310:40pezThe main differences I see are that in the existing code base most re-frame (reg-.* forms and (:require are indented with 2 spaces, while they have no special treatment by cljfmt defaults (i.e. they are indented with 1 space).#2020-11-0310:46pezI seem to make Calva mostly behave together with Cursive on this project using this cjfmt.edn:
{:remove-surrounding-whitespace? true
:remove-trailing-whitespace? true
:remove-consecutive-blank-lines? false
:insert-missing-whitespace? true
:align-associative? true
:indents {#"^reg-" [[:inner 0]]
#"^:require" [[:block 0]]}}
(Note that align-associative? isn’t standard cljfmt , it is just on my fork. And it doesn’t behave nearly as stellar as Cursive’s one.)#2020-11-0310:49pezI’ll let you know if I find out enough about this to provide https://calva.io/formatting/ with a settings example for Cursive defaults compatibility.#2020-11-0303:41rutledgepaulvI just ran into a small issue where I think cursive is resolving an unqualified get symbol in my namespace on repl startup even though I've done a (:refer-clojure :exclude [get]), so cursive either can't find the var and errors with "Error initialising locals clearing:" or if i define my own get in the namespace then cursive actually invokes my function (which also errors). I filed an issue: https://github.com/cursive-ide/cursive/issues/2459#2020-11-0310:22cflemingWow, that looks funky - I’ll check that out, thanks.#2020-11-0507:02onetomI might have asked this already, but is there a way to customize the REPL prompt for nREPL connections?#2020-11-0510:51cflemingIn Cursive, there really is no REPL prompt - which is the part you’d like to customise?#2020-11-0515:09onetomthere is a => in the output, but that's not really a prompt indeed.
what i would like is the same kind of thing as clojure.main/repl-prompt, so i can constantly reflect some state of my program.
more specifically i would use it to switch between different deployment environments (using different aws profiles, ssh keys, domain names) and evaluate expressions, which would implicitly depend on the current environment.#2020-11-0515:09onetomso before i evaluate something, i would see which environment will it going to be evaluated.#2020-11-0515:31onetomim practically trying to use cursive as a unix shell replacement, so it feels like i would need something like a shell prompt.#2020-11-0513:06pezIs there a way to fold maps?#2020-11-0513:08pezContext: We are trying with inlining tests into the function attribute maps. It often gets that tests take up much more space than the function itself and the Cursive users in the project do not seem to be able to fold the attribute map.#2020-11-0513:10imreA question on that: how do you keep test-only requires out of the prod namespace this way?#2020-11-0513:15pezWe don’t. 😃#2020-11-0513:34imreAh, okay then 🙂#2020-11-0513:24manutter51You can fold any selection with Command-Period on the Mac, I assume PC is similar.#2020-11-0615:20Vincent Cantin@cfleming Hi, I just noticed that Cursive does not mark the renamed variable as resolved in this snippet: https://clojuredocs.org/clojure.core/ns#example-5fa507fae4b0b1e3652d73ff#2020-11-0615:21Vincent Cantin#2020-11-0622:59cflemingYes, there’s an issue about that, I’m going to try to look at it soon.#2020-11-0917:48kennytiltonI am using Cursive 1.9.4 - 2020-10-20 and suddenly am unable to index projects:
12:41 PM Error reading /Users/kennytilton/dev/crawlingchaos/project.clj
Cannot run program "clojure" (in directory "/Users/kennytilton/dev/crawlingchaos"): error=2, No such file or directory
error=2, No such file or directory
What did I do now?! 🙂 The command clojure brings up a prompt in that directory, and I created a symlink named clojure anyway and it still brings up a prompt. I must be misinterpreting that error. Any ideas appreciated. 🙏#2020-11-0918:13kennytiltonI just recreated the IntelliJ project from sources, problem unchanged.#2020-11-0921:00kennytiltonAnother team member sees the same on a diff repo.#2020-11-0921:01kennytiltonCatalina is a suspect. It is aways a suspect.#2020-11-0923:10kennytilton(Some of us) had to tell lein-tools-deps where to find clojure
:lein-tools-deps/config {:clojure-executables ["clojure" "/usr/local/bin/clojure"]
:config-files [:install :user :project]}#2020-11-0923:10kennytiltonEven tho it was on our path, btw.#2020-11-1000:45cflemingSo with that, is the problem fixed? That’s possible, since IntelliJ doesn’t use the same CWD or PATH as lein itself.#2020-11-0921:08Felipe de MoraisI would like to use kaocha as my test runner, how could I tell Cursive to use kaocha to run my tests? 👀#2020-11-1000:46cflemingSadly, right now, you can’t, although testing in general is something I’m working on at the moment.#2020-11-1014:19imreAlthough it doesn't integrate with gutter markers, etc, I use custom repl commands for this:
run all
(do
(require 'clojure.spec.alpha 'expound.alpha 'kaocha.repl)
(binding [clojure.spec.alpha/*explain-out* expound.alpha/printer]
(kaocha.repl/run-all)))
run current repl ns
(do
(require 'clojure.spec.alpha 'expound.alpha 'kaocha.repl)
(binding [clojure.spec.alpha/*explain-out* expound.alpha/printer]
(kaocha.repl/run)))#2020-11-1013:37EmpperiOK. I've spent this day debugging a problem where my integration tests just hang indefinitely. Now I've come to conclusion that it is actually a bug in Cursive and more specifically in the part of code that evaluates test assertion diffs.
The reason why I've come to this conclusion is because if I execute tests from command line with lein test everything works fine. They also work fine in REPL if I use run-tests. This is true both for command line lein repl and within Cursive lein repl. However, if I use "Run tests in Current NS in REPL" keyboard shortcut (which I use all the time) they hang when a database query is done. To make matters more weird, this doesn't happen with all my tests, just this one causing issues. Also, if I remove assertions using is then they do not hang (but naturally tests are useless).
Unfortunately I cannot share code which causes this issue. It is using HikariCP, next.jdbc and PostgreSQL database for this specific test. One additional thing is that my integration tests are wrapped with defintegrationtest macro which I can share:
(defmacro defintegrationtest
"Defines an integration test. The main effect of this is a proper binding
to 'lein test :integration'. Otherwise this is identical to normal deftest."
[name & body]
(when *load-tests*
`(def ~(vary-meta
(vary-meta name assoc :integration true)
assoc :test `(fn [] #2020-11-1013:38EmpperiIf I change that to deftest the situation doesn't really change though#2020-11-1013:38EmpperiHowever I am using test-ns-hook functionality within Clojure test#2020-11-1307:20cflemingSorry for the slow reply on this - is the failing test the only one using test-ns-hook?#2020-11-1013:40EmpperiI wish I could give more information but this is a super weird bug and it is super annoying#2020-11-1014:45Joe R. SmithIdk if this is a cursive bug, but if I start a REPL from within intellij/cursive and then start a Jetty webserver, the webserver persists after intellij is closed.#2020-11-1014:46Joe R. SmithMy expectation is that it'd die with the repl process that started it (nrepl)#2020-11-1019:20Empperi@solussd this is what you will get if you try to exit IntelliJ with active REPL session. If you choose "disconnect" then REPL process is left alive and so is your Jetty. If you choose "terminate" REPL process is also killed as is your Jetty. If you however have checked "don't ask me again" and have chosen "disconnect" then it will perform like you described. So no, not a bug in Cursive.#2020-11-1019:22EmpperiI'm quite certain remembering the option can be reverted from somewhere#2020-11-1019:26Joe R. Smith@niklas.collin thanks- that explains it. I had slightly different reasoning. I assumed, incorrectly, that the repl process was a sub-process of intellij, but that doesn't make sense now that I think about it.#2020-11-1019:26EmpperiWell it actually is#2020-11-1019:26EmpperiBut it is tracked properly#2020-11-1019:32Joe R. Smith@niklas.collin fixed:#2020-11-1019:32EmpperiHappy to help#2020-11-1112:20scarytom@cfleming getting this strange behaviour, and wondered if I'm missing something obvious#2020-11-1310:58scarytomHas anyone seen this before?#2020-11-1320:28cflemingNot that I’m aware of, I’ll try to reproduce it. Is this CLJ, CLJS or CLJC?#2020-11-1423:08scarytomjust plain old clj#2020-11-1609:25Rachel WestmacottI can reproduce it.#2020-11-1609:25Rachel Westmacottsame code, same error message#2020-11-1609:26Rachel Westmacottit seems to be require specific - other functions (e.g. println, count) don't cause the error#2020-11-1823:15scarytom@cfleming did you try this out yet? The issue isn't really affecting me massively, but I am curious about it.#2020-11-1909:00cfleming@UCQV87CN7 No, I’ve been off work for a couple of days but I’ll look at this when I’m back.#2020-11-1909:29scarytomNo worries, thanks.#2020-11-2006:07cfleming@UCQV87CN7 So this is just a common or garden variety bug, although it’s a tricky one. require was one of the first forms I added support for (along with all the other ns-related stuff), and since the ns form is so complicated I cribbed a bunch of code for parsing it from tools.namespace, including this: https://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/parse.cljc#L63-L70#2020-11-2006:09cflemingMuch of this code never got retrofitted to use my grammar parsing stuff which would have caught this. So this is still using old parsing code, which tries to parse the forms passed to require as a libspec and decides (due to that check) that it’s a prefix form.#2020-11-2006:12cflemingSo when a form is a prefix form, the initial symbols will sometimes but not always refer to namespaces. If you have (require '(clojure string (java io))) for example, there’s actually no namespace called clojure anywhere, so Cursive marks that symbol as something that shouldn’t be resolved, since in an actual prefix forms that’s often valid. Obviously, no namespace called -> exists 🙂#2020-11-2006:13cflemingThen, since that symbol is marked as not resolving to anything, when Cursive is trying to figure out the arity that’s being used for string/split it looks at the parent list to see if it’s a threading form. But the head symbol doesn’t resolve to anything, so it can’t be, which is why Cursive thinks it’s not in a threading form when it actually is.#2020-11-2006:14cflemingThe moral of the story is, as I have been preaching but obviously not entirely practising, is to always use grammars to parse your forms rather than ad-hoc parsing like this.#2020-11-2006:17cfleming(even when that ad-hoc parsing comes from something battle-tested like tools.namespace)#2020-11-2009:13scarytomWow, that's quite a journey. Thanks very much for the explanation, it's very interesting, and I've learnt a lot from it.#2020-11-1310:58scarytomHas anyone seen this before?#2020-11-1208:04saitouenaIs there any way to rename ns a.b to a.c.b ?
I could rename a.b to a.c with M-x refactor-this + Rename but I couldn't do it for the above case.
I think cursive currently cannot do it if it moves over directories. Is that correct?#2020-11-1208:04cflemingThat’s correct right now, but this will be possible soon.#2020-11-1208:06saitouenaI appreciate it so much! 👍
I'm looking forward to it.
It would make it easier to refactor project structure.#2020-11-1208:06cflemingYes, no doubt!#2020-11-1216:33folconI've been trying to get nrepl working inside wsl2 for a while now and I'm not having much luck, has anyone else being trying this? Specifically running intellij in windows and trying to connect the remote repl to an nrepl instance via shadow-cljs running within wsl2. All of my ports appear to be open, but for some reason nrepl refuses connections. Does it not accept any external connections by default or something? I can definitely connect to it within wsl2 and I can connect to other running parts of shadow-cljs.#2020-11-1217:49tanzoniteblackwhat host are you using? localhost or the explicit IP address of the WSL2 instance?#2020-11-1217:50tanzoniteblackI have no idea if that's relevant or not, but random things like that do trip me up sometimes with wsl2 interop#2020-11-1217:50tanzoniteblackI also use windows+wsl2 for development. But, I just run intellij from wsl2 directly, using x410 as an x server on the windows side#2020-11-1217:52folconI've tried both, as well as using ssh to do port forwarding, it's surprisingly opaque.#2020-11-1217:53folconHmm, does that end up working well? I'm a little concerned about whether that's going to cause odd quirks like file system slowdowns or keyboard shortcut issues?#2020-11-1217:56tanzoniteblackhttps://nrepl.org/nrepl/usage/clients.html
clj -Sdeps '{:deps {nrepl {:mvn/version "0.8.3"}}}' -m nrepl.cmdline --connect --host host --port port
are you able to connect directly from powershell?#2020-11-1217:56tanzoniteblackand it works well for me. I use intellij professionally for kotlin / javascript / clojure & do all of it directly in wsl2#2020-11-1217:57tanzoniteblackI haven't had any issues related to file system slowdowns as long as your code is also in the wsl2 disk. the file system speed issues only exist when accessing files from windows instead of the local partition#2020-11-1217:58tanzoniteblackno issues with keyboard shortcuts, but x410 does stick to the keyboard layout that you started it with. So if you switch between different windows keyboards (like I do with Russian & Chinese), they don't work directly in the intellij window.#2020-11-1217:59tanzoniteblackonly other annoyance is x410 connections are done over tcp, and those connections don't survive shut downs or sleep. So you have to close intellij before you turn off your computer#2020-11-1217:59tanzoniteblackthe windows team is supposed to be releasing a native version of handling gui apps from wsl2 this year. I'm hopeful those will fix those issues for me 🙂#2020-11-1217:59tanzoniteblackbut they're all pretty minor for my workflow#2020-11-1218:07folconHmm, that's pretty lucky. I'm assuming hibernating would also be an issue, which would be a problem for me. Sometimes leaving my code overnight and being able to just dive back in the morning is really helpful 😃...#2020-11-1218:08folconI've been testing with:
lein repl :connect 127.0.0.1:8777
Which I assume is similar? It certainly works within the wsl bash shell...#2020-11-1218:08folconTrying it from powershell isn't great however#2020-11-1218:09tanzoniteblackyeah, hibernating also has the same issues#2020-11-1218:09tanzoniteblackin order to debug if it's a "windows thing" or "cursive/java thing", you'll probably need to be able to test it from powershell#2020-11-1218:10folconThe interesting thing is if I remove the entries in netsh portproxy then the response changes:
with: netsh interface portproxy add v4tov4 listenport=8777 listenaddress=0.0.0.0 connectport=8777 connectaddress=172.18.255.20
lein repl :connect 0.0.0.0:8777
Connecting to nREPL at 0.0.0.0:8777
SocketException Connection reset
java.net.SocketInputStream.read (:-1)
java.net.SocketInputStream.read (:-1)
java.io.BufferedInputStream.fill (:-1)
java.io.BufferedInputStream.read (:-1)
java.io.FilterInputStream.read (:-1)
java.io.PushbackInputStream.read (:-1)
bencode.core/read-byte (core.clj:87)
bencode.core/read-byte (core.clj:-1)
bencode.core/read-token (core.clj:239)
bencode.core/read-token (core.clj:237)
bencode.core/read-bencode (core.clj:257)
bencode.core/read-bencode (core.clj:254)
Bye for now!
without:
lein repl :connect 0.0.0.0:8777
Connecting to nREPL at 0.0.0.0:8777
ConnectException Connection refused: connect
java.net.DualStackPlainSocketImpl.connect0 (:-2)
java.net.DualStackPlainSocketImpl.socketConnect (:-1)
java.net.AbstractPlainSocketImpl.doConnect (:-1)
java.net.AbstractPlainSocketImpl.connectToAddress (:-1)
java.net.AbstractPlainSocketImpl.connect (:-1)
java.net.PlainSocketImpl.connect (:-1)
java.net.SocksSocketImpl.connect (:-1)
java.net.Socket.connect (:-1)
java.net.Socket.connect (:-1)
java.net.Socket.<init> (:-1)
java.net.Socket.<init> (:-1)
nrepl.core/connect (core.clj:178)
Bye for now!
So it's connecting to something?#2020-11-1218:11tanzoniteblacktry connecting to the actual IP address of the wsl2 virtual machine.
you can get that by running ip addr in the wsl2 terminal & pulling the value for eth0#2020-11-1218:13folconNope, then you just get the connection refused, which makes sense as there's no open port on that IP address I think? Actually, I wonder if this is windows firewall being clever#2020-11-1218:15folconNope that's not it either#2020-11-1218:19tanzoniteblackno more ideas. Sorry#2020-11-1218:20folconThanks for the help anyway 😃#2020-11-1219:09folconFinally figured it out I think?
Well sort of, I can connect to it via ssh if I use an alternative port via:
ssh -L 8778:localhost:8777
So I guess that's one way of doing it >_<...#2020-11-1308:34saitouenaI tried to make shadow-cljs.edn recognized by cursive in this way https://github.com/thheller/shadow-cljs/issues/70#issuecomment-341895828
but I couldn't figure out the way to import generated pom.xml to cursive. Is there anything to do to import it?#2020-11-1308:41saitouenahttps://github.com/cursive-ide/cursive/issues/1804#issuecomment-528441496
I might have misunderstood this. Importing pom.xml feature haven't been implemented yet but thheller suggested it would be a solution.#2020-11-1308:57thheller@tetsu.ponpon2000 pom.xml imports require the Maven plugin to be enabled. It should be enabled by default but it might not be. make sure it is enabled and then import the pom.xml via "project from existing sources"#2020-11-1309:06saitouenaThanks for your reply.
I made it sure the maven plugin is enabled and then tried "project from existing sources" but it didn't work.
I think it's because my project is multi-module project and my pom.xm generated by shadow-cljsl is in the sub module.#2020-11-1309:07saitouenaI might need to bring pom.xml to the top directory of the project and merge it with the existing pom.xml or something like that.#2020-11-1309:09thhellerpretty sure you can import pom.xml as a module too but I've never used that#2020-11-1309:11saitouenaI'll try to recreate my cursive project and to import my settings again. It might be a remedy.#2020-11-1309:49cfleming@tetsu.ponpon2000 You should be able to right click on the pom.xml and choose “Add as Maven project” or something similar.#2020-11-1607:51saitouenaThanks for your replies.
What I want to do is making cursive to recognize shadow-cljs.edn dependencies without modifying my project.clj. I added shadow-cljs dependencies to :dev profile of my project.clj for a remedy but I don't like it.
https://github.com/cursive-ide/cursive/issues/1804#issuecomment-528441496
I tried this with the following steps:
• generate pom.xml with shadow-cljs pom
• right click pom.xml and choose "Add as a Maven project"
Cursive hasn't recognize my shadow-cljs dependencies yet. It reports rf cannot be resolved on (:require [[re-frame.core :as rf]]) . Is there anything to do on top of that?#2020-11-1607:52cflemingThat should be (:require [re-frame.core :as rf])#2020-11-1607:53cflemingYou have your []s doubled up.#2020-11-1608:22saitouenaIt's my typo. My actual source code is ok.#2020-11-1808:01royalaidHey @cfleming been playing around with https://github.com/jpmonettas/flow-storm, seems like #trace data reader can’t be resolved#2020-11-1821:28cflemingOk, I’ll take a look, I think this should work.#2020-11-2500:02cflemingSo I investigated this, what’s happening is that Cursive expects the data reader tags to be qualified, per the doc: https://clojure.org/reference/reader#tagged_literals
> Reader tags without namespace qualifiers are reserved for Clojure.#2020-11-2500:04cflemingI guess non-qualified tags work but are frowned upon. I’m always unsure what to do in these cases.#2020-11-2502:56royalaidLooks like this is a pattern that is emerging#2020-11-2502:56royalaidhttps://github.com/weavejester/hashp/blob/master/src/data_readers.clj#2020-11-2502:57royalaidBecause people want short strings when debugging things#2020-11-2503:16cflemingOk, I’d better add support for that, then.#2020-11-2603:24cfleminghttps://github.com/cursive-ide/cursive/issues/2464#2020-11-1808:02royalaidIs this expected? Poking around a bit in old issue a while back seems to imply that data readers should be generally supported#2020-11-1911:29HenryIt is strange that the "find usages" action work for some files but not for others. Wonder if anyone has experienced the same and know why or how to fix it? Thank you.#2020-11-1911:53HenryFYI, I was going through fulcro-rad-tutorial when the issue occurred. https://github.com/fulcrologic/fulcro-rad-tutorial#2020-11-1912:08AJ Jaro@UVDMR4Y75 I have this trouble a bit, but I think my experiences are with CLJC and CLJS mappings#2020-11-1914:43Henry@UGMAVSMUM Thanks for sharing. I spent more time digging around and can confirm that the issue only exists in CLJC files and only pertains to the find usages and navigation actions of the namespaces inside (:require ...). A temporary solution I found: for CLJC files, put all required namespaces inside of reader conditionals (#? or #/cdn-cgi/l/email-protection) and the actions should work properly. @U0567Q30W Would like to share this finding. Not sure why this happen this way, but hopefully there could be a better fix. Thanks a lot for creating such an amazing tool.#2020-11-1914:52Michael WI have problems with that rad demo too, because the files on disk don't match the 'normal' layout for namespaces it confuses the IDE.#2020-11-1914:53Michael WI changed the layout on disk and made it simpler.#2020-11-1920:42cflemingInteresting, I’ll take a look at that. I’m surprised by that since Tony and the others that I know of who work on Fulcro all use Cursive.#2020-11-2500:13cfleming@UAB2NMK25 I just took a look at this project. When you talk about the layout, do you mean the dev directory which isn’t added as a source root?#2020-11-2500:15cflemingIf so, that’s added as in the dev alias (`:extra-paths` in the deps.edn), so you need to tell Cursive to use that alias when syncing: https://cursive-ide.com/userguide/deps.html#working-with-aliases#2020-11-2018:42Jakub Holý (HolyJak)Is there a way to teach Cursive to resolve symbols pointing to functions in another namespace, re-exported via a custom macro? There are fns such as tech.v3.dataset/column-count that are re-exported from a namespace that I require like this:
(exporter/export-symbols tech.v3.dataset
column-count
row-count)
When I require ☝️ as middleman-ns, I want Cursive to understand that middleman-ns/column-count is a fn. The exporter: https://github.com/cnuernber/dtype-next/blob/master/src/tech/v3/datatype/export_symbols.clj#L4#2020-11-2105:09cflemingThere isn’t out of the box right now, but I’m planning some support for this. There are a few libraries out there that do this just with def too, and I’ve planned to add support for that for a while now.#2020-11-2105:10cflemingI’ll take a look at that macro when I fix this.#2020-11-2109:55ikitommiis there an easy way to edit a file inside a dependency (jar)? With emacs, you can make a buffer editable - modify the contents and reload that file into a repl: you can basically live-edit you dependencies, which is really awesome. With IDEA, can’t make the buffer/view editable. Could copy the content somewhere else and edit there, but looking for a cleaner way for this.#2020-11-2109:55ikitommi#2020-11-2109:57ikitomminot looking for any permanent changes, just ability to change what the current repl sees.#2020-11-2110:12imreThis would be awesome. I do remember seeing an idea command to make a file editable, not sure if it helps here#2020-11-2110:26cflemingThere isn’t, but this is something a few people have asked for. One idea I had was an action to convert a file from a jar into a scratch file, which you could then edit and send to the REPL.#2020-11-2110:41ikitommithat would be great. Two big benefits:
• ability to use things like #p (hashp) or tap> (with portal / reveal) from 3rd party libs
• ability to try / fix small things in libs. currently working with a lot of alpha libs (many ours), which are great, but full of gaps that would be to add/fix locally in the calling project as you find them. git-sha-deps-flow simplifies things a lot, but this would allow fixes to be instant.#2020-11-2111:04cflemingOk, I’ll check in the JetBrains slack how best to achieve that.#2020-11-2302:06sogaiupossibly not so helpful here, but fwiw i have some clojure code in: https://github.com/sogaiu/alc.index-defs
that extracts .clj* files from dependency jars and makes them avaiable under a .alc-id subdirectory of one's project.#2020-11-2304:21cfleminghttps://github.com/cursive-ide/cursive/issues/2463#2020-11-2310:25Jakub Holý (HolyJak)FYI What I do is switch the repl to the ns of the file, copy-paste the fn to that file, adjust, eval. But ☝️ would be much more comfortable#2020-11-2317:56mike_ananevbrew install mc
mc
Just run Midnight Commander, put cursor on jar file and hit Enter. Use F4 to edit. Like in old good days..#2020-11-2320:55cflemingWhat’s been implemented is copying to a scratch file, as described in that issue:#2020-11-2320:55cflemingScratch files are still a bit funky, but it seems to work pretty well.#2020-11-2314:59Caro AHi, I'm trying to get up and running with Cursive behind a corporate proxy. I have leiningen, clojure, jdk all installed and can happily run my project from the commandine. However, when I try to load the project in intellij, cursive tries to download a standalone binary for Leiningen, which is forbidden by the proxy. Is there a way to get cursive to recognise the lein binary of the same version that I have installed? I'm on Linux, javac 11.0.3 from openjdk, lein 1.9.2, intellij 2019.3 and cursive 1.9.1-2019.3 if that makes any difference. Thanks!#2020-11-2400:00cflemingCursive will download the leiningen uberjar to ~/.lein/self-installs, which is where lein itself will download it to. Check which versions you have there, if you have a specific version in that folder then you can tell Cursive to use that version at Preferences | Build, Execution, Deployment | Build Tools | Leiningen#2020-11-2410:30Caro AI don't have anything in .lein/self-installs, but I have what seems to be a lein binary at /usr/local/bin/lein. I didn't do the setup, but I can only assume this is from an operating system package rather than curling some script to install lein. Is there a way to get cursive to look on $PATH for lein, or to use this specific location for the binary?#2020-11-2421:18cflemingLein is two parts - it’s an uberjar containing the actual lein code, and a script which handles downloading the uberjar and running it. That’s what /usr/local/bin/lein is. In the script, there’s probably a line like:
LEIN_JAR="$LEIN_HOME/self-installs/leiningen-$LEIN_VERSION-standalone.jar"
Do you have LEIN_HOME set to something other than ~/.lein?#2020-11-2617:42dimaHello. Is it possible to sort namespace requires alphabetically when formatting file?#2020-11-2620:08cflemingIt’s not right now (apart from dpsutton’s workaround), but this is something I’ve been working on recently. I had to park it for a while, but it will be in sometime soon.#2020-11-2700:52saitouenaI usually do it with cljstyle with the integration with file watcher.
https://github.com/greglook/cljstyle
https://cdn-ak.f.st-hatena.com/images/fotolife/e/egs33/20200214/20200214162956.png#2020-11-2900:44AJ JaroThere's also a plug-in for IntelliJ
https://plugins.jetbrains.com/plugin/13222-clojure-namespace-sort#2020-12-0913:08dimaAnd there is one more plugin for that https://plugins.jetbrains.com/plugin/12731-amethyst#2020-11-2617:51dpsuttoni've seen coworkers make sure that the requires are each on a line (ie, add a newline after :require and before the final closing paren) and then use the built-in intellij feature to sort lines.#2020-11-2711:39dimaDidn’t know about intellij Sort lines It works, thanks for suggestion!#2020-11-2709:54heliosSomething strange. In my require i have
[re-frame.context :as re-frame :refer [defc]] (it's a fork of re-frame)
But later down in the text, where i have re-frame/subscribe cursive offers to require the ns#2020-11-2716:30imreWhy does cursive format tagged literals like this:
#kaocha/v1
{:plugins [:kaocha.plugin/profiling
:kaocha.plugin/print-invocations
:kaocha.plugin/cloverage
:kaocha.plugin.alpha/spec-test-check]}
and not like
#kaocha/v1
{:plugins [:kaocha.plugin/profiling
:kaocha.plugin/print-invocations
:kaocha.plugin/cloverage
:kaocha.plugin.alpha/spec-test-check]}
?#2020-11-2719:49cflemingGreat question, I have no idea - I’d have to look at that.#2020-11-2723:45pezcljfmt does something similar, although only one space indent. Maybe it is to show what is tagged? It makes a bit of extra sense when readers stack. Like so:
#kaocha/v1
#foo/bar
#baz
{:plugins [:kaocha.plugin/profiling
:kaocha.plugin/print-invocations
:kaocha.plugin/cloverage
:kaocha.plugin.alpha/spec-test-check]}#2020-11-2801:35cflemingI don’t think I did it on purpose in Cursive, it’s probably just an artifact of sub-elements in the AST being indented by default. I’d have expected 2 spaces rather than 4, though.#2020-11-2807:48imreMy personal preference would be to have no indentation for these: a) they belong together b) that would match my teammates' spacemacs default formatting 😁#2020-11-2808:10pezCould be a similar artifact in cljfmt, I can't see that the behaviour is documented.#2020-11-2722:47tony.kayI’m reading in the docs that ~file-namespace is supposed to sub in REPL commands as the current namespace. It is not expanding for me. Is this a typo in docs?#2020-11-2722:49tony.kayhm…strangely, it expands if I put it on a line by itself#2020-11-2722:52tony.kayI figured it out. Strange issue, but here it is:
I wanted to reload the file myself (so I could catch compiler exceptions), and I tried this: (require '~file-namespace :reload) in the REPL command. That did not expand; however, if I do this it works:
(let [n '~file-namespace]
(require n :reload))
#2020-11-2820:51cflemingThanks, I’ll take a look - that should work anywhere.#2020-11-2816:27lilactownhi! I had a user report an issue when using Cursive with my library: https://github.com/lilactown/helix/issues/79#2020-11-2820:51cflemingI’ve asked them for the version of Cursive they’re using, I think this is fixed in the latest version.#2020-11-2816:28lilactownit looks like the CLJS analyzer is throwing on "stub generation" due to a require that looks like ["react" :as react], which AFAIK is a perfectly valid require#2020-11-2816:28lilactownshould I tell them to follow up here, or is this a #cljs-dev issue?#2020-11-3014:29imreFYI https://github.com/cursive-ide/cursive/issues/2466#2020-11-3014:43Alex Miller (Clojure team)this is really a problem in deps.edn, which cannot successfully pass the jvm-opts with spaces in it due to bash word splitting#2020-11-3014:44Alex Miller (Clojure team)same issue as https://clojure.atlassian.net/browse/TDEPS-56 (I don't think I have one specifically for jvm-opts, but same thing)#2020-11-3015:15imreThanks for the info, Alex. I added a link to the Cursive ticket#2020-11-3018:45Rebecca Star👋 im having an issue with dependency resolution. I am trying to import an existing project into cursive, that has a project.clj with some profiles. One of the profiles has :local-repo "local-m2" set. If i comment out that line, everything imports fine, but with it, i am getting Dependency resolution error...Failed to collect dependencies at... . Has anyone else seen this issue, or know of some setup step I may be missing?#2020-11-3019:27cflemingNo, there have been some historical problems with this, but I think it should all work in newer versions. I’ll try to find some time to test this shortly.#2020-11-3019:28Rebecca Starok thanks, let me know if theres any info i can provide to help debug#2020-12-0107:43heliosI opened a project with deps.edn, but i don't see the "Clojure Deps" toolbar. So when i change deps it doesn't prompt me to import/refresh them. How do i solve it?#2020-12-0107:46heliosi just added a clojure-deps.xml manually from another project i had, but what would have been the kosher way to get it?#2020-12-0107:58cflemingI think probably, right-clicking on the deps.edn file and selecting “Add as deps project” - I’m not sure why that wouldn’t have worked from the initial import, perhaps something went wrong with it.#2020-12-0107:58mike_ananevwhen you open deps.edn file select Open as project#2020-12-0108:41heliosNote that i had already an IntelliJ project with REPL and everything configured, just it wasn't recognized as a Deps project. Not sure what happend on initial import. I've seen this occur more than once though. I'll remember it for next time and maybe we'll investigate#2020-12-0111:35mike_ananevIt is invalid project. Close project and remove it from recent project history in IDEA. then, reopen project by openning deps.edn file as Project.#2020-12-0110:03helioshttps://clojurians.slack.com/archives/C0744GXCJ/p1606470844280100
does this look like a cursive bug?#2020-12-0207:39steveb8nQ: when Intellij releases native support for Apple M1 chips, I’m gonna get a Mac Mini to try it out. Is there anything about Cursive that needs porting or should it “just work”?#2020-12-0208:05cflemingIt’ll just work as much as IntelliJ does. They’re working on M1 support for the JDK they use, but it’s not there yet. Apparently now it runs ~70% of the speed of a current system, depending on what you’re doing. Gradle is very slow for some reason.#2020-12-0208:06cflemingETA is sometime this year though, I think.#2020-12-0208:12steveb8nyeah, I’ve seen the reports of Rosetta being slow to run the JVM.#2020-12-0208:13steveb8nbut a $1500 desktop that is twice as fast as my MBP is so tempting! Xmas present to myself if the JVM can benefit from that speed#2020-12-0208:13steveb8nthanks for the info#2020-12-0220:57cfleminghttps://twitter.com/intellijidea/status/1331993497788960768#2020-12-0220:58cfleminghttps://youtrack.jetbrains.com/issue/JBR-2526#2020-12-0220:59cflemingI’m also tempted by the mini, I’ve been planning to try working on one for a while now and the M1 makes it a no-brainer. But I’ll wait till it’s properly supported.#2020-12-0216:38kennyI updated to 2020.3 and it seems to have broken the namespace search functionality. I am on Cursive 1.9.4-2020.3. I have attached the stacktrace from the IntelliJ logs. Reverting to 2020.2 for now.#2020-12-0303:19tapIt's broken for me as well.#2020-12-0217:21imreI noticed that Cursive doesn't seem to persist per-project code style settings between sessions. Has anyone come across this?#2020-12-0308:22cflemingFor those having problems with namespace switching: https://groups.google.com/g/cursive/c/r6ORtyx4nnM/m/TlFKB-EABAAJ (@kenny, @tap and others)#2020-12-0308:24tapThank you#2020-12-0401:58cfleminghttps://twitter.com/CursiveIDE/status/1334678405002842112#2020-12-0403:25salami just tried the new test runner and it works like a charm! this is huge, especially for folks who are used to the traditional tdd approach in intellij idea. i just found a minor bug as shown in the screenshot attached. anyway, thanks a lot!#2020-12-0403:47cflemingThanks! I’m glad it’s useful, I already use it all the time. With that screenshot, did the error message persist even after entering a display name, or had that been defaulted when you opened it?#2020-12-0403:59salamyes and yes: when i created the run configuration, the error message was already there even though the Display Name was already pre-populated with the default value that was the same as that for Name (“Unnamed”). changing the Display Name didn’t make the error message go away. #2020-12-0404:00cflemingHmm, strange, thanks - I’ll try to reproduce that.#2020-12-0404:45cflemingI can’t reproduce this. I’ll see if anyone else has the same problem and and see if I can see any pattern in who’s getting it.#2020-12-0405:08salamthat’s strange. i’ll go back and try it again.
this might just be me nitpicking but the other thing that’s been bugging me about this run configuration window is the way some options are indented. i feel like the labels “Host”, “Port,” and “Context Module” can use more indentation to make it clear that they are the children of the “Connect to server” radio button (same amount of indentation that the “Project” label has under the radio button “Use port from nREPL file”.)#2020-12-0405:33cflemingGood idea, I’ll fix that.#2020-12-0415:26kennyI see a new play button next to my deftests. If I click it I see several options: Run test, debug test, run with cpu profiler, ... If I click run with cpu profiler, I get a red popup in the corner pointing to the Run tab saying "Error running 'Test user/my-test': Internal error: Don't know how to patch selected configuration" Is running with cpu profiler not currently supported?#2020-12-0419:47cflemingI’m not sure about that actually, I’ll check it. I’m hoping to add coverage support, but it’s more complicated than I hoped because of how Clojure works.#2020-12-0501:44cflemingActually @UDCGPTV9R sorry, I can repro your error, I was trying it with a local REPL not a remote one. I’ll fix that.#2020-12-0502:08cflemingAlso fixed the indentation, and the marking elements disabled is now more consistent and obvious too.#2020-12-0503:59cfleminghttps://twitter.com/CursiveIDE/status/1335067469967314945#2020-12-0505:32salami just checked out the new EAP build and it looks great! now that the tabs have a close button (X) in them, is there any difference between that button and the one in the toolbar of the REPL tool window? the latter seems redundant now?#2020-12-0507:54cflemingPossibly, I think mostly it makes that consistent with the run config action toolbar, although you’re right that it’s probably not needed.#2020-12-0519:27ikitommicopy to scratch file 👍 👍 👍#2020-12-0519:46AJ JaroThanks @U0567Q30W for fixing the namespaced keywords!! Huge!!#2020-12-0519:51cflemingThanks everyone! @UGMAVSMUM In recent IntelliJ versions that is becoming a complex and subtle area of the code which is also difficult to test automatically - let me know if you see any more weirdness.#2020-12-0519:52AJ JaroFor sure I definitely will do. I know how much I appreciate this tool so anyway I can help is great!#2020-12-0522:29kenny@U0567Q30W Not sure if this is the display name bug you mentioned. I updated to 1.10.0-eap2-2020.3 and all my run configs have this red X next to them.#2020-12-0602:13cfleming@U083D6HK9 Did you get that with eap1?#2020-12-0602:13kennyYes#2020-12-0602:14cflemingSo that’s a different problem that I talked about in the release notes - the migration which fixes the display name field for existing run configs doesn’t fix IDE-local ones, only project-shared ones.#2020-12-0602:14cflemingIf you choose edit configurations and open those configs and then apply, that should fix it - the defaulting will be done in the editor.#2020-12-0602:15kennyWhat’s the difference between IDE-local and project-shared?#2020-12-0602:52cflemingIf you look in the REPL run config, there’s a checkbox in the top right - “Store as project file”. If that’s checked, then the run config will be stored as a separate file in .idea and can be shared in VCS etc.#2020-12-0602:55kennyAh, got it. Will try this tomorrow. Thanks. #2020-12-0412:54roklenarcicWhat’s the trick for getting to connect to remote Babashka REPL? The connect process just waits#2020-12-0416:01pezHave you started babashka with an nrepl server?#2020-12-0416:01borkdudehttps://book.babashka.org/#repl and ctrl-f for Cursive#2020-12-0416:02borkdudeif that info is out of date, please let me know#2020-12-0503:59cfleminghttps://twitter.com/CursiveIDE/status/1335067469967314945#2020-12-0500:54markwHey all - new to Cursive and coming from CIDER - wondering if there is anything comparable to eldoc style function signature hints that stay out of the way in the minibuffer, highlighting each parameter as you come across it?#2020-12-0501:02cflemingIt’s not quite the same, but there’s this: https://cursive-ide.com/userguide/documentation.html#parameter-info#2020-12-0501:03cflemingThe one thing it doesn’t do yet is highlight the parameter you’re currently at.#2020-12-0501:12markwYeah I did notice this feature and it is very close . I just personally prefer the fixed location in the minibuffer. Nit-picky I know! 🙂 Thanks for getting back to me#2020-12-0501:12markwReally liking Cursive so far#2020-12-0501:16cflemingGreat! I’m glad it’s working out for you.#2020-12-0519:12kennytiltonIs there any way to have Cursive auto-format, say, the :requires list under an ns form so the :as (or :refer`) options all line up? I would offer an example but Slack is fighting me. :)#2020-12-0612:59devnWhy is it that there is no inspection for global unused declaration, but I see fn names highlighted as being unused?#2020-12-0619:36cflemingThat one is an editor-only inspection. The one that should work for global vars is the general unused declaration inspection, but for some reason it doesn’t work and I haven’t got around to investigating it yet.#2020-12-0810:11cflemingJust checking - is anyone using the new test runner stuff? Is it working ok? I’ve only had one bit of feedback that a simple test worked, so that means either it’s all working fine or no-one is using it 🙂. If it’s working I’ll get a stable build out soon so users upgrading to 2020.3 aren’t bitten by the namespace navigation bug.#2020-12-0813:49AJ JaroIt definitely works for me, but I’m not at the point to include it in my workflow. I normally use the REPL so that the liquibase DB changes don’t have to be run every time I run the tests, they only have to run the first time.
I have some ideas on making it a bit better, however it generally works so it’s good enough to shipit
There are some neat things that it looks like are included in this, so I can see this tool continuing to grow in the future and being really great for sure.#2020-12-0817:21kennyI'm not entirely sure how to integrate the test runner stuff into my workflow. Maybe I'm missing something. We already have a flow set up to run tests (kaocha) on CI. When running tests, it seems best to run them in the same manner that they'd run on CI. During development, I almost always have a REPL open and will run my tests using one of the REPL shortcuts. Running a test or tests in a fresh JVM takes a long time -- the initial boot up can be like 30-40s for a large application.#2020-12-0817:23kennyThe one piece that did seem useful for certain scenarios was the ability to run a test using the cpu profiler or java flight recorder.#2020-12-0820:07cflemingThanks for the feedback everyone, I agree that the REPL workflow is the most useful for development. I mostly use the full test suite as a sanity check for not having broken anything after making changes, although CI should pick those up too.#2020-12-0820:07cflemingI’ll check the CPU profiler thing too.#2020-12-0820:08cflemingI’m also hoping to integrate coverage information which would be useful.#2020-12-0822:46AJ Jaro@cfleming for sure! I think there are going to be some really cool enhancements coming out of this#2020-12-0822:51salamas i mentioned before, the test runner feature might be more appealing to those who come to clojure from other languages where the only way to run tests is via a fresh jvm (java, scala, etc.) during the transition period (maybe). i myself run my tests using kaocha with its --watch feature in a terminal these days... so... if this test runner one day can do just that, i.e., running tests reusing the same jvm upon changes to files (the --watch feature), i can totally see myself switching to it. i think intellij idea already supports this for running jest tests within the ide: https://www.jetbrains.com/help/idea/running-unit-tests-on-jest.html#createRunConfigJest#2020-12-0822:52cflemingInteresting, thanks - back in the day I asked JetBrains about that and their runner didn’t support it. I guess they’ve added that in a recent version, I’ll ask about it again.#2020-12-0810:26msolli@cfleming I tested it briefly. My rather big application takes north of 30 seconds to start. My usual workflow is to run the tests in a repl (with “Run Tests in Current NS in REPL” and friends bound to custom key combinations). Since the new test runner spins up a new instance of the app it just takes too long. Admittedly I should address the underlying problem, but there is always going to be some startup cost that is greater than just running the tests in a repl.#2020-12-0810:27cflemingThanks for the feedback. But I assume that if you do “lein run” or whatever then it takes the same amount of time, right? i.e. it’s not actually a problem with the runner itself.#2020-12-0810:28cflemingOne thing I had thought of was allowing the run config to execute in the active REPL instead of opening up a new process, but that’s unfortunately hard because the IntelliJ testing stuff is very tied to starting a process. But that might not be impossible if there’s interest.#2020-12-0810:31msolliI start the process with lein repl in the terminal, then I connect using a “Remote REPL” run configuration. This way my application process lifetime is not tied to IntelliJ. The test runs are instantaneous when run this way.#2020-12-0810:34msolliHm, I’m trying out different stuff now. Seems I can’t edit the Leiningen run configuration now. The window’s just empty.#2020-12-0810:34msolliI’ll post a screenshot in a sec…#2020-12-0810:36msolli#2020-12-0820:05cfleming@U06BEJGKD Could you send me your log file, please? Help | Show log in Finder#2020-12-0810:39msolliA question about protocols: Is it (or rather, should it be) possible to find implementations of protocols using Option-Command-B (Navigate -> Implementation(s))?#2020-12-1021:00kingmobI'd also love this functionality.#2020-12-0810:39imre@cfleming I also gave it a brief try just now and it seems to be working well. However my workflow is also repl-focused. I'd load the project, start the repl inside idea and work and run tests within the repl connection.
For CI we use the kaocha test runner so before pushing I'd run that from the command line. I also have repl commands to run kaocha in-repl. Integrating kaocha with idea would be interesting to me as we use its plugin system etc so the tests being run through kaocha are different to what Cursive's built-in test runners discover#2020-12-0910:24onetomhow does Cursive determines whether a deps path should be a Sources root or a Test sources root?
can i somehow avoid this?
manually marking the folder as sources root is not enough; Refresh Clojure Deps Project reverts it back to test sources.
i have a directory which has only 1 clj file in it and it keeps being recognized as test sources.
it doesn't contain tests, though im requiring clojure.test in it, because i've implemented some feature using kaocha.runner/-main.#2020-12-0910:53cflemingSource roots are marked as tests if they’re in the test alias. This isn’t configurable at the moment. I made a change a while ago to allow arbitrary source roots to be marked as test roots and Cursive would leave them that way, but I haven’t made the equivalent change in the other direction (which would basically be to leave all source root type markings alone).#2020-12-0911:38cjmurphyI just have an alias with a different name: :tset.
:tset {:extra-paths ["src/test"]}#2020-12-0916:06hadilsHi I am using Intellij Ultimate 2020.3 with Cursive. One change I've noticed is that the namespace no longer shows up in my local REPL tab. Is there a way I can fix this?#2020-12-0916:09manutter51Might be related to this: https://groups.google.com/g/cursive/c/Ybcgx_oTS7c#2020-12-0916:10manutter51(That’s an email from Colin talking about Cursive 1.10.0-eap1 — he mentions a bug in 2020.3 related to namespaces, not sure if that’s the same thing you’re talking about#2020-12-0916:41hadilsThanks @manutter51#2020-12-0920:46JAtkinsHow can I figure out what is wrong with stubs generation? I'm seeing some error appearing when I try to generate them for my project, but the description only contains the *out* of the clj process, which isn't very enlightening. AFAICT there shouldn't be any errors at all.#2020-12-0921:05JAtkinsActually, could it be related to this: https://github.com/cursive-ide/cursive/issues/2066 . I get a warning from slf4j#2020-12-0921:05JAtkinsIt's printed on *err* though#2020-12-0921:50JAtkinsI can silence my *err* stream with "-Dorg.eclipse.jetty.util.log.announce=false" . I put that in my dev alias (which is enabled in the project view). It removes all prints to *err* while starting the repl, but it appears that this option is not applied while building stubs... How do I control the build of the stub generator?#2020-12-0922:31JAtkinsAfter much ado, I realized that I could put
(java.lang.System/setProperty "org.eclipse.jetty.util.log.announce" "false")
in my user.clj. That fixes it. However, can this be documented elsewhere? This was a 1.5 ish hour problem, and it's not obvious at all that cursive is doing it's own thing without deps.edn, and that it crashes on anything printed to *err* (except those redefinition warnings).#2020-12-1001:40cflemingI’ll document that and add it to the troubleshooting page in the userguide, thanks. The short answer is that when you run an external process, having output on stderr is often the only way to know that a problem occurred - I’ve seen a lot of cases where the process exit code isn’t set to an error condition.#2020-12-1001:44JAtkinsRight. I just never thought of it. Perfectly reasonable behavior, once you’ve thought of it :)#2020-12-1001:44JAtkinsThanks!#2020-12-0920:50JAtkinsAlso, I accidentally clicked Disable on the stub generation failure popup... I see nothing in either main settings or project settings to undo that. I don't see a diff in my project files, so I have no idea how to undo this ;p#2020-12-0922:08JAtkinsFound under Project Settings -> Modules -> (Clojure Tab) -> Create stubs if required#2020-12-0922:48JAtkinsanyway, all of that was me trying to get rewrite-clj.potemkin/import-vars to resolve correctly as potemkin/import-vars. Unfortunately, this is still not working. After invalidating cache and rebuilding stubs and verifying that the macro is resolved as potemkin/import-vars, documentation/autocomplete still don't work.#2020-12-1001:41cflemingThat should work, I think - I’ll have a look at that and see if I can reproduce it.#2020-12-1001:42JAtkinsThanks. This usually works fine, but something is weird today :/. Btw I’m on IntelliJ 2020.3 and cursive eap #2020-12-1001:21salamColin, before you release cursive 1.10.0, do you mind fixing this NPE which seems to be new?
java.lang.NullPointerException
at cursive.scratch.CopyLibraryFileToScratchAction.update(Scratches.kt:46)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:178)
at com.intellij.ide.util.gotoByName.GotoActionModel.updateActionBeforeShow(GotoActionModel.java:337)
at com.intellij.ide.util.gotoByName.GotoActionModel$ActionWrapper.lambda$getPresentation$0(GotoActionModel.java:701)
at com.intellij.ide.util.gotoByName.GotoActionModel.lambda$updateOnEdt$4(GotoActionModel.java:495)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:216)
at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:24)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:199)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:324)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:85)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:134)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:190)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:976)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:843)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:454)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:773)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:453)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:822)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:501)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
#2020-12-1001:43cflemingDone, thanks.#2020-12-1004:00cfleminghttps://twitter.com/CursiveIDE/status/1336882984251576322#2020-12-1009:37stijnnamed REPLs are 💯 !#2020-12-1010:19cflemingGreat!#2020-12-1010:49helioscongrats on shipping @cfleming 😄#2020-12-1023:32cflemingThanks @U0AD3JSHL! I was worried about this one since I’m about to move cities so I didn’t want it to all go to pot, but it was the smoothest EAP ever, especially one that contains a lot of new stuff - phew!#2020-12-1421:11Lucio AssisThank you SO MUCH for the test runner and the lib file scratches! These will help me immensely!#2020-12-1012:24HenryQuick question: in terms of "send top form to repl", is there a way for the result to be printed directly next to the form in the file, instead of the repl? Thank you.#2020-12-1023:33cflemingThere isn’t at the moment, but it’s something I’m planning to implement very soon.#2020-12-1605:12genekimIncredible! I’ve always loved that in LightTable! 🎉🎉 I always assumed it would be impossible inside IntelliJ. Brilliant!#2020-12-1605:12genekim🤞🤞🙏🙏😃😃#2020-12-1608:28cflemingIt actually was until the last couple of releases, but they’ve made a lot of great changes there in the 2020.x series.#2020-12-1018:05royalaidhttps://github.com/cursive-ide/cursive/issues/394 Hey @cfleming, just wondering if this issue is on your radar? Running into renamed functions behind undefined#2020-12-1023:32cflemingYes, I’ve been meaning to look at that one, I’ll try to do it for the next EAP.#2020-12-1100:17royalaidTy and thanks for the generally quick turn around on other issues I have raised!#2020-12-1018:05royalaidThis happens in both ns forms and let destructuring#2020-12-1220:27vmarcinkojust a short question... Has Cursive removed current namespace name in the running REPL tool window title ? wasn't it there before?#2020-12-1220:30vmarcinkosorry about last question - i had better read last version changlog#2020-12-1413:49manutter51Not sure if this is strictly on topic, but after upgrading to the latest IDEA and Cursive versions, I notice I’m now running 24 separate instances of /Applications/IntelliJ IDEA 2020.3.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.6.0.jar org.jetbrains.idea.maven.server.RemoteMavenServer36, which is not something I ever intentionally initiated. Is anybody else seeing that?#2020-12-1420:11cflemingNo idea what that might be, sorry.#2020-12-1420:15manutter51No worries, it’s not a major resource hog as far as I can tell, so it’s more curiosity than concern.#2020-12-1413:50manutter51Oh, hmm, I kill -9’ed one of them, and now all 24 are gone… :thinking_face:#2020-12-1413:51manutter51Welcome to Monday Morning Mysteries™. Now I’m off to get more coffee 😵#2020-12-1421:51msshas anyone had any luck manually installing cursive from disk? I’ve verified that I have the correct version of cursive for my version of intellij, but cursive keeps crashing on startup with the error:
java.lang.NoClassDefFoundError: clojure/lang/DynamicClassLoader
#2020-12-1503:21onetomWaaaah, the REPL tabs show the name of the run config!!!
Very nice, indeed! - to quote Protesilaos Stavrou :D#2020-12-1513:02heliosi'm doing quite a bit of Babashka work in Cursive, but it's a bit of a pity that some stuff can't be resolved babashka.curl, etc. Do you have any idea?#2020-12-1513:03borkdude@helios does it help if you add a deps.edn with babashka.curl in it?#2020-12-1513:05helioswhere should i add it?#2020-12-1513:06helioshow would cursive know that that specific deps.edn applies to the bb script?#2020-12-1513:08borkdudeI'm not sure, was just a lucky guess.#2020-12-1515:24Janne SauvalaI added deps.end file to my bb project and added this. This is seemed to help resolve the dependency
{:deps
{babashka/babashka.curl {:mvn/version "0.0.1"}}}#2020-12-1618:14daniel.spanielI really like the new REPL tabs label concept. At first it worked fine, then now the labels collapse and they are blank. Has anyone seen this ? I am on the latest intellij 2020.3 built on Nov 20 2020#2020-12-1618:19manutter51I had that when I first upgraded, I fixed it by opening each run config and filling in the Display Name field (which is new and probably empty).#2020-12-1618:41daniel.spanielAh, so i had them already filled in, and when i upgraded (it showed X on the label in the config dropdown ) seems like you need to resave that REPL after touching the label ( retype the last char ) and then save .. and then it shows up .. odd .. but ok .. back in business#2020-12-1618:41cflemingYes, this is the IntelliJ bug with the run config migrations I mentioned in the release email.#2020-12-1618:42daniel.spanieloh .. man .. facepalm did not read that .. sorry#2020-12-1618:51cflemingNo worries, it’s still not entirely obvious that that is the cause even if you did read it!#2020-12-1620:09hadilsI find that symbols in datomic.ion and datomic.ion-dev do not get resolved by Intellij/Cursive (2020.3 Nov 20, 2020) because I have a repo definition in deps.edn. This is causing my stub generation to crash as well as showing these symbols as undefined. Anyone have a solution to this?#2020-12-1723:39cflemingWhat’s the error you get from stub generation? You should be able to see it in the log file at Help | Show log in Finder/Explorer#2020-12-1801:55hadilsSLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/hadilsabbagh/.m2/repository/org/slf4j/slf4j-nop/1.7.25/slf4j-nop-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/hadilsabbagh/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See for an explanation.
SLF4J: Actual binding is of type [org.slf4j.helpers.NOPLoggerFactory]
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at clojure.lang.RT.classForName(RT.java:2211)
at clojure.lang.RT.classForName(RT.java:2220)
at clojure.lang.RT.loadClassForName(RT.java:2239)
at clojure.lang.RT.load(RT.java:449)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:930)
at datomic.ion.dev.bundle$loading__6721__auto____6441.invoke(bundle.clj:3)
at datomic.ion.dev.bundle__init.load(Unknown Source)
at datomic.ion.dev.bundle__init. (Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at clojure.lang.RT.classForName(RT.java:2211)
at clojure.lang.RT.classForName(RT.java:2220)
at clojure.lang.RT.loadClassForName(RT.java:2239)
at clojure.lang.RT.load(RT.java:449)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:2088)
at datomic.ion.dev$loading__6721__auto____6274.invoke(dev.clj:3)
at datomic.ion.dev__init.load(Unknown Source)
at datomic.ion.dev__init. (Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at clojure.lang.RT.classForName(RT.java:2211)
at clojure.lang.RT.classForName(RT.java:2220)
at clojure.lang.RT.loadClassForName(RT.java:2239)
at clojure.lang.RT.load(RT.java:449)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at cursive.stubs.metadata.clojure$read_ns.invokeStatic(clojure.clj:65)
at cursive.stubs.metadata.clojure$read_ns.invoke(clojure.clj:64)
at user$eval15051.invokeStatic(create-stub15273084368453599599.clj:5)
at user$eval15051.invoke(create-stub15273084368453599599.clj:5)
at clojure.lang.Compiler.eval(Compiler.java:7177)
at clojure.lang.Compiler.load(Compiler.java:7636)
at clojure.lang.Compiler.loadFile(Compiler.java:7574)
at clojure.main$load_script.invokeStatic(main.clj:475)
at clojure.main$init_opt.invokeStatic(main.clj:477)
at clojure.main$init_opt.invoke(main.clj:477)
at clojure.main$initialize.invokeStatic(main.clj:508)
at clojure.main$null_opt.invokeStatic(main.clj:542)
at clojure.main$null_opt.invoke(main.clj:539)
at clojure.main$main.invokeStatic(main.clj:664)
at clojure.main$main.doInvoke(main.clj:616)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:40)
Caused by: java.io.FileNotFoundException: Could not locate clojure/tools/deps/alpha/reader__init.class, clojure/tools/deps/alpha/reader.clj or clojure/tools/deps/alpha/reader.cljc on classpath.
at clojure.lang.RT.load(RT.java:462)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:1289)
at datomic.ion.dev.classpath$loading__6721__auto____6519.invoke(classpath.clj:3)
at datomic.ion.dev.classpath__init.load(Unknown Source)
at datomic.ion.dev.classpath__init. (Unknown Source)
... 99 more
Disable stub generation for module stackz-ion
#2020-12-1803:07cflemingHmm, that’s not a very useful error message. Are you able to share this project so I can take a look at it?#2020-12-1814:51hadilsNo, it's proprietary, sorry. I can show you parts of it...tell me what you would like to see in particular, if possible...#2020-12-1814:55hadilsHere's my deps.edn file:#2020-12-1815:25hadilsThe problem centers around datomic.ion-dev#2020-12-1904:09cflemingThanks. I’m travelling tomorrow but I’ll try to look at this next week.#2020-12-1620:28asilverman@cfleming Cursive debugger no longer stops at breakpoints for my project, can I please get some help?#2020-12-1723:38cflemingDoes this happen for all projects, or just one?#2020-12-1707:25steveb8nQ: I have a couple of questions about the testing integrations in Cursive…#2020-12-1707:26steveb8n1/ how does the new test runner feature work within the REPL? Or does it not?#2020-12-1707:26steveb8nI use “Run test in REPL” all the time. I can’t see how the new features add new capabilities#2020-12-1707:27steveb8n2/ is anyone using Greenlight integration tests with a Cursive integration?#2020-12-1707:27steveb8nI’ve created a simple project to show what I mean: https://github.com/stevebuik/cursive-testing-integrations/blob/master/src/various_tests.clj#2020-12-1716:57AJ Jaro@U0510KXTU I have taken a look at the test runner but don’t use it as part of my workflow. Based on what I saw, this is independent of the REPL.
No, to part 2. I don’t use Greenlight#2020-12-1721:12steveb8n@UGMAVSMUM thanks for the reply. That’s what I suspected#2020-12-1721:52cflemingRight, the new test integration is independent of the REPL, at least for now. I would like to add a “Run tests in open REPL” option, but that’s tricky for intellij reasons which I haven’t had time to look at yet.#2020-12-1721:52cflemingI don’t know of anyone using Greenlight, no, sorry.#2020-12-1808:52steveb8nThanks for the clarification#2020-12-1722:29wilkerlucio@cfleming hello, one idea I just had here for the deps window, would be nice if it could make separated groups for project vs global aliases, so its easier to understand what alias come from a project, makes sense?#2020-12-1723:37cflemingYes, definitely.#2020-12-1722:34kennyRefactor > rename is broken in 1.10.0-2020.3. Take this code.
(s/def ::foo int?)
Right click on the keyword. Go to Refactor > Rename. This pops open the modal seen in screenshot 1. Changing "foo" to "foo2" results in a red message saying "'foo2' is not a valid identifier". If I add a double colon in from of "foo2" and click Refactor, the modal closes and nothing happens.#2020-12-1722:40kennyOpened an issue. https://github.com/cursive-ide/cursive/issues/2473 This is a big issue for my workflow 😬#2020-12-1722:40kennyIt's kinda like it's now treating s/def's as symbols.#2020-12-1723:13cflemingUgh, this is probably a side effect of https://github.com/cursive-ide/cursive/issues/2457. There were a bunch of platform changes affecting navigation, I’ll get this fixed ASAP.#2020-12-1723:14kennyThank you @cfleming!#2020-12-1723:14cflemingSorry for the breakage, a lot of this stuff is really hard to test in automated tests since it’s quite tied to the UI.#2020-12-1723:15kennyYeah, that's crossed my mind before. I have no idea how you do it 🙂#2020-12-1723:16cflemingThere are actually some facilities for GUI testing now, but they’re still a pain to use. I actually use them for generating the screenshots in the documentation, so if I document something then as a side effect it gets tested when I regenerate the doc 🙂#2020-12-2321:44kenny@cfleming Potentially related to this is usually when your cursor is on a keyword, it will highlight all keywords that are the same. That is not happening in the latest version.#2020-12-1805:20onetomI'm getting this error:
Errors during project resolution
The following errors were found during project resolve:
Could not find artifact com.datomic:ion-dev:jar:0.9.276 in central ()
It's supposed to be downloaded from the datomic-cloud mvn repo, which I've defined in my deps.edn files as:
:mvn/repos
{"datomic-cloud"
{:url ""
:why? "required by :ion-dev alias"}
}
and the alias relying on it is defined as:
:ion-dev {:extra-deps {com.datomic/ion-dev {:mvn/version "0.9.276"}}}
using the aws credentials from my default aws profile i can indeed have permission to download this artifact:
➜ nix-shell -p pkgs.awscli2 --run 'aws s3 cp /tmp/'
download: to ../../../../tmp/ion-dev-0.9.276.pom
(works on the .jar file too, im just testing it with the .pom, because it's smaller)
using Clojure CLI tools, the artifact is successfully downloaded:
➜ rm -rf ~/.m2/repository/com/datomic/ion-dev/
➜ clj -A:ion-dev -Sforce
Downloading: com/datomic/ion-dev/0.9.276/ion-dev-0.9.276.pom from datomic-cloud
Downloading: com/datomic/ion-dev/0.9.276/ion-dev-0.9.276.jar from datomic-cloud
Clojure 1.10.1
user=>
The problem in Cursive however persists.
I've tried the "Use tools.deps directly" option too with tools.deps version 0.9.857 and using the CLI tools with /nix/store/g7cpwnmzfl9ikxnm7gbnq3qqgj0mynwk-clojure-1.10.1.754/bin/clojure, but the problem persists.
The problem it causes is that all the library entries are gone from my *.iml files, which really pollutes the list of changed files when im trying to commit, because i see 14 changed iml files.#2020-12-1805:28onetomIs it possible that Cursive is not using my default AWS credentials?
How can we debug this?#2020-12-1805:58onetomI'm on Cursive 1.10.0-2020.3 and
IntelliJ IDEA 2020.3 (Ultimate Edition)
Build #IU-203.5981.155, built on December 1, 2020
Licensed to Tamas Herman
Subscription is active until November 27, 2021
Runtime version: 11.0.9+11-b1145.21 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 10.15.7
GC: ParNew, ConcurrentMarkSweep
Memory: 3005M
Cores: 8
Registry: ide.allow.merge.buttons=false, ide.settings.move.mouse.on.default.button=true, suppress.focus.stealing.disable.auto.request.focus=true
Non-Bundled Plugins: AceJump, IdeaVIM, Org4Idea, PlantUML integration, com.4lex4.intellij.solarized, com.alayouni.ansiHighlight, com.intellij.ideolog, com.intellij.plugins.watcher, com.paperetto.dash, de.netnexus.camelcaseplugin, io.protostuff.protostuff-jetbrains-plugin, net.vektah.codeglance, org.intellij.RegexpTester, name.kropp.intellij.makefile, org.plugin.dot.id, org.toml.lang, com.github.pshirshov.bytecodeeditor, com.intellij.plugins.html.instantEditing, com.cursiveclojure.cursive, Pythonid, org.asciidoctor.intellij.asciidoc
#2020-12-1807:24Alex Miller (Clojure team)it is almost certain that you're not seeing the right aws creds - you can set them as env vars in your run config#2020-12-1807:24Alex Miller (Clojure team)I know I have definitely done exactly this before#2020-12-1808:14cflemingThat will work for run configs, but I think onetom is talking about syncing the project to IntelliJ. That’s done in the IntelliJ process so the env vars would have to be set for the whole process I think.#2020-12-1808:15cflemingThat’s annoying to do depending on platform though, I’ll check to see if there’s a better solution.#2020-12-1810:37Jakub Holý (HolyJak)@cfleming you might want to update https://cursive-ide.com/userguide/#download-intellij, part
> Cursive will work with IntelliJ versions from the last two years, currently 2017.3, 2018.x and 2019.x.
adding 2020.x as well.
Question: Where can I find out whether it is safe to upgrade to latest IntelliJ (currently 2020.3), i.e. that people have tried that Cursive works just fine with it? I have been burnt before by updating to eagerly....#2020-12-1812:25imreI'm using 2020.3 and haven't run into any blockers. But I suppose it doesn't hurt if you scroll up in this channel a bit#2020-12-1903:58cflemingThanks @U0522TWDA, yes, I actually have that updated in local as part of a larger doc update, but it got parked by non-work stuff. It’ll be updated in the next couple of days.#2020-12-1903:59cflemingI’m not aware of any 2020.3 issues at the moment. There are a couple of issues with Cursive 1.10.0 (https://github.com/cursive-ide/cursive/issues/2471 and https://github.com/cursive-ide/cursive/issues/2473) which will be fixed in the next couple of days.#2020-12-1917:05vmarcinkoBTW, anyone knows how can I generate implementation of protocol functions for given record...It seems by this documentation this should be possible: https://cursive-ide.com/userguide/editing.html#implement-and-override-methods#2020-12-1917:05vmarcinkoOr I misunderstood something?#2020-12-1917:07vmarcinkoI expected something to point to my record and pick something like implement Methods and specify desired protocol, and stubs for protocol functions should appear udner record or such ?#2020-12-1917:15vmarcinkoOK, I managed to make it, it just has a bug it seems that duplicates the name of protocol... So what I did, I entered the name of desired protocol within the record parens, and then have chosen "Implement Methods", and the result was this:
(defprotocol MailSender
(send-email [this from to text]))
(defrecord DefaultMailSender [smpt-host smpt-port]
MailSender
MailSender
(send_email [this from to text]))
#2020-12-2006:00cflemingSo actually this (shamefully) doesn’t support protocols at the moment, it only supports implementing Java interfaces. But since protocols also create an interface, I suspect Cursive is getting confused there. I’ll try to fix this soon.#2020-12-1917:15vmarcinkoso you see, duplciated protocol name...The first one I entered to be able to place caret on it and choose "Implement Methods"#2020-12-1918:16genekimDo any of y’all change the IntelliJ memory settings? After numerous suspends/resumes on my MacBook Pro, I start getting more and more “spinning wheels of death”, where I think the JVM is doing stop-the-world GC cleanups. It becomes increasingly less tolerable, and then I have to reboot (usually hard reboot, because various apps refuse to stop running).
Are there things you do that prevent this inevitable decline of the usability of IntelliJ/Cursive over time? Thank you!
(Part of me was researching how to have IntelliJ use one of the newer GCs like Shenandoah, but luckily, managed to contain my worst impulses, and likely avoided the fate of bricking my dev setup. 🙂#2020-12-2006:01cflemingI just set the max memory to 2G and don’t worry about the rest, although that’s unlikely to be optimal. I actually suspect I have a memory leak in the parinfer stuff if you happen to be using that, but I haven’t had time to track it down yet.#2020-12-2017:26genekimTotally can’t imagine life without parinfer! 🙂
No worries — life is great. I’ll just quit and restart IntelliJ more often. Totally not a big deal.
Happy holidays to you and yours, all!#2020-12-2003:49JAtkinsToday I am running into a really weird bug. The "projects" tab is no longer visible in my project. Additionally, it appears that all cursive project management, since my files are not under a source root, dependencies cannot resolve, and goto definition fails. The funny thing is I can still see the "repl" window in the side, create run configurations with local or remote repls, and use sexp based editing. I'm on IntelliJ 2020.3 (just updated today to see if that was the issue) and Cursive latest (non EAP) (also reinstalled today).#2020-12-2006:02cflemingWhen you say the projects tab, do you mean that the projects toolwindow is not visible?#2020-12-2006:03cflemingIt sounds like a more fundamental issue is happening though, can you send me your log file (Help | Show log in Finder/Explorer) to <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection>?#2020-12-2008:51JAtkinsThe deps window that is installed with cursive is the one that went missing. I’ll send tomorrow afternoon. It’s not mission critical for me, since it’s only my laptop and for now my desktop is fine. #2020-12-2115:39JAtkinsBad news. The issue is now being repeated on my desktop 😬 . Weirdly enough it doesn't happen on every project. I'm just being careful right now to not crash intellij so I don't have to re-open my work project.#2020-12-2116:36JAtkinsSolution found: click the deps.edn file in the file tree, and add as deps project. Weirdly, I thought I had tried something similar already when I had closed the projects and used the Open -> open "deps.edn" as project file -> importing... set of menus. Thanks @U066U8JQJ#2020-12-2121:29cflemingHmm, that is weird, did this problem start after upgrading IntelliJ?#2020-12-2121:59JAtkinsMaybe? I was on some version of IntelliJ 2020.2 before when the problem first arose#2020-12-2122:37kennyHow is Cursive supposed to work with :local/root deps? Didn't it used to automatically import local/root as a module so that the REPL would recognize file changes and automatically reload them when you run load file in repl?#2020-12-2200:07cflemingYes, I think that’s still the case. What is not working for you?#2020-12-2200:07kennyIt treats the local/root as an external dep.#2020-12-2200:08kennye.g., opens the tab in a tan color. If I try to edit, it pops open "Non-Project files protection"#2020-12-2200:08kennyThe tab's path is the local root directory too.#2020-12-2200:12cflemingDo you have the dependency deps.edn file added as a deps project?#2020-12-2200:12kennyNo#2020-12-2200:40cflemingIf you add that, does it help?#2020-12-2200:41kennyYes. It also adds it to .idea/clojure-deps.xml though. That file is in VCS. Not everyone wants my local project added to their IntelliJ setup (it also may not have the same path)#2020-12-2200:42cflemingOh, are you adding this via a user deps.edn or something?#2020-12-2200:42kennyNo. A project's deps.edn.#2020-12-2200:42cflemingOk, but that project isn’t checked into VCS?#2020-12-2200:42kennySo I have 1 monorepo IntelliJ project. There's a bunch of modules. One of those modules uses :local/root to a project outside of the IntelliJ project root directory.#2020-12-2200:43kennyIt is but it's in a separate repository.#2020-12-2200:55cflemingHmm, I see. Could you file an issue for that and I’ll look at it?#2020-12-2201:11kennyhttps://github.com/cursive-ide/cursive/issues/2474. Super busy today, so I hope that'll do it. Let me know if you need any other info.#2020-12-2201:11cflemingThanks, I’ll take a look in the next couple of days and let you know if I need more info.#2020-12-2212:41akielHi, can I force stub generation? I have a project using clojure.java-time . Cursive did generate the stubs about a month before. But now with 1.10.0-2020.3 Cursive had some errors while generating stubs. After the errors even reopening the project doesn’t generate the stubs.#2020-12-2313:33akielI can force the stub generation with an “Invalidate & Restart” in the File menu. However after starting stub generation, I get the following exception:
#2020-12-2313:33akielcom.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
at com.intellij.openapi.project.IndexNotReadyException.create(IndexNotReadyException.java:67)
at com.intellij.util.indexing.FileBasedIndexImpl.handleDumbMode(FileBasedIndexImpl.java:752)
at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:704)
at com.intellij.util.indexing.FileBasedIndexEx.processExceptions(FileBasedIndexEx.java:229)
at com.intellij.util.indexing.FileBasedIndexEx.processValueIterator(FileBasedIndexEx.java:334)
at com.intellij.util.indexing.FileBasedIndexEx.processValuesInScope(FileBasedIndexEx.java:303)
at com.intellij.util.indexing.FileBasedIndexEx.processValues(FileBasedIndexEx.java:204)
at com.intellij.util.indexing.FileBasedIndexEx.processValues(FileBasedIndexEx.java:192)
at cursive.index$namespaces.invokeStatic(index.clj:443)
at cursive.index$namespaces.invoke(index.clj:435)
at cursive.index$namespaces.invokeStatic(index.clj:438)
at cursive.index$namespaces.invoke(index.clj:435)
at cursive.namespace$namespaces_by_name.invokeStatic(namespace.clj:230)
at cursive.namespace$namespaces_by_name.invoke(namespace.clj:224)
at cursive.stubs$stub_file_name$reify__15640.compute(stubs.clj:68)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:875)
at cursive.stubs$stub_file_name.invokeStatic(stubs.clj:67)
at cursive.stubs$stub_file_name.invoke(stubs.clj:57)
at cursive.stubs$clj_namespace_form.invokeStatic(stubs.clj:98)
at cursive.stubs$clj_namespace_form.invoke(stubs.clj:97)
at cursive.stubs$generate_stubs$fn__15692$process__15693$fn__15697.invoke(stubs.clj:265)
at clojure.core$keep$fn__8559.invoke(core.clj:7341)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.RT.seq(RT.java:535)
at clojure.core$seq__5402.invokeStatic(core.clj:137)
at clojure.core$map$fn__5866.invoke(core.clj:2746)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:51)
at clojure.lang.LazySeq.first(LazySeq.java:73)
at clojure.lang.RT.first(RT.java:692)
at clojure.core$first__5384.invokeStatic(core.clj:55)
at clojure.string$join.invokeStatic(string.clj:180)
at clojure.string$join.invoke(string.clj:180)
at cursive.stubs$generate_stubs$fn__15692$process__15693.invoke(stubs.clj:264)
at cursive.stubs$generate_stubs$fn__15692.invoke(stubs.clj:325)
at cursive.task$backgroundable$reify__15626.run(task.clj:12)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:962)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:472)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:834)
#2020-12-2313:33akielThe project is https://github.com/samply/blaze. One file with clojure.java-time is https://github.com/samply/blaze/blob/master/modules/db/test/blaze/db/api_test.clj#2020-12-2422:23cschephey all, I have a brand new clojure project I created with Cursive, trying to use deps.edn and I have a src folder with a module.. all super basic just hello world style code.. I had a test alias setup in deps.edn but i removed it because I found a way to run the tests within Cursive and I thought that was cool. I’m not sure what caused it, could have been editing the deps.edn file but now my project view only has a few things in, deps.edn being one of them.. but no folders listed and no modules and basically nothing works now because it can’t find any modules?#2020-12-2422:23cschepreally confused 🙂#2020-12-2422:23cschepi can still run clj -m schepball.core on the command line and it runs the hello world code#2020-12-2422:25cschepreading the thread above, i was able to fix my situation with the steps here#2020-12-2422:25cschephttps://clojurians.slack.com/archives/C0744GXCJ/p1608568616457500?thread_ts=1608436184.453600&cid=C0744GXCJ#2020-12-2506:30Saurabh Sharanwhat is the best way to debug Could not create shim: Could not create shim error when trying to start the REPL on a cjl deps project?#2020-12-2606:18cflemingGet your log from Help | Show log in Finder/Explorer and email it to me at <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection>#2021-12-2810:13onetomIf i have the same alias (eg. ion-dev) in my ~/.clojure/deps.edn and my project's deps.edn, what will Cursive do about it?
In the Clojure Deps tool window, under the Aliases tree, I can only see one entry and that mentions (system) after its name.
I'm asking, because it seems to be the key to the Errors during project resolution issue I've described a few days ago:
https://clojurians.zulipchat.com/#narrow/stream/180378-slack-archive/topic/cursive/near/220338073
both my ~/.clojure/deps.edn and project deps.edn did have an ion-dev alias, but only my project deps.edn specified datomic-cloud in :mvn/repos, which is necessary for the :extra-deps {com.datomic/ion-dev {:mvn/version "0.9.276"}}#2021-12-2810:15onetomIt feels like Cursive is doing something slightly different from the Clojure CLI tools in such scenario, because the clojure script didn't have a difficulty in starting a REPL in such a situation.#2021-12-2820:35cflemingHmm, that’s possible, I’ll check that.#2021-12-2820:39cfleminghttps://github.com/cursive-ide/cursive/issues/2477#2021-12-2819:26wilkerluciohad anyone experience the keyword search just stopped working? I can find the keywords manually in the project, but in Cursive keyword search there are no results#2021-12-2819:26wilkerlucioalthough find usages on a keyword work as expected, just the search doesn't#2021-12-2820:35cflemingAre you on the latest Cursive? I’ll investigate that.#2021-12-2823:12wilkerlucioyup, latest#2021-12-2823:14wilkerluciosome keywords appear in the search, but not all#2021-12-2823:15wilkerlucioI think its worth mention this project has a ton of keywords, just wondering if its hitting some limit#2021-12-2823:15wilkerluciohere is one example#2021-12-3001:58steveb8n@cfleming I’m starting to use Malli in place of spec because it’s better in many ways. I miss the navigation on keywords that is supported for spec keywords. How do you decide when there’s enough adoption to provide navigation for Malli keywords? cc @ikitommi#2021-12-3001:59cflemingI would definitely add support now for Malli. What’s required?#2021-12-3002:17steveb8nawesome. initially just having the static analyzer understand when a keyword is defined in a Malli registry somewhere would allow you to provide the navigation that I desire#2021-12-3002:19steveb8nthat said, registries in Malli are not global (one of the benefits) so it will need to handle multiple nav locations (much like “show usages”)#2021-12-3002:20steveb8nI’d defer to Tommi for the official answer to this. I’m pretty sure he uses Cursive too. Is that correct? @ikitommi#2021-12-3002:20steveb8nhappy to provide some samples if you need/want them#2021-12-3005:58cflemingI’ll check the Malli docs and let you know if I need more examples. If @ikitommi has worked around it using Resolve As… then it should be pretty easy to add.#2021-12-3007:49cflemingI’d be interested in seeing some examples of where you’d like to see the navigation work. I’ve looked at the registry doc and it seems pretty open, so I’m not clear where the hooks for navigation should be.#2021-12-3007:50steveb8nsure. it’s probably fastest to look at some of my code so we can derive a few samples together. that work for you?#2021-12-3007:51steveb8nand should/would @ikitommi like to join? I think he might be on holiday atm#2021-12-3007:53cflemingI can’t do tonight but could do tomorrow.#2021-12-3016:14ikitommiGreat to hear that Cursive could support malli! In current version, there is no global schema definition, like there is s/def in spec. Instead, there can be multiple registries that are merged together, and one can build custom def for registering schemas. So, atm, not sure where to goto.#2021-12-3016:16ikitommithere Will be a new ns with Plumatic style def, defn and fn. Would be great if Cursive would handle those out-of-the-box, like the Plumatic ones. I'll ping @cfleming when the ns ships.#2021-12-3016:17ikitommibut, if you can cook up something for the goto-definition, I'm all ears :)#2021-12-3016:20ikitommiAlso, happy to help with anything that could help, add stuff to malli to Make it easy to integrate to etc.#2021-12-3020:22cflemingDoes just resolving the custom def as s/def work?#2021-12-3020:30ikitommithe plumatic def is not about registering key->schema like the spec s/def, but to define a value and the schema it represents, with eager validation: https://github.com/plumatic/schema/blob/master/src/cljx/schema/core.cljx#L1386-L1408#2021-12-3020:32ikitommiI think the goto would require a single global registry and a. custom def to register key->schema into it. No such thing in malli right now.#2021-12-3021:38steveb8nI have some ideas for the goto nav. Not sure how sophisticated Cursive can be but there are signals in the AST that a keyword is part of a Malli schema e.g. {:registry foo} could be the start of a walk back to :map keywords#2021-12-3021:39steveb8nalso https://github.com/metosin/malli/blob/master/test/malli/core_test.cljc#L1392-L1470#2021-12-3014:55emilaasaMy yearly appreciation post cfleming - you're great, the product is great, enjoy your holidays!#2021-12-3020:23cflemingThanks Emil, it’s much appreciated! I hope everyone has a good holiday season too.#2021-12-3017:55acim1Does anyone know if there is a way to eliminate "cannot be resolved" warnings for mount defstate declarations (and their usages)?#2021-12-3018:04mike_ananev@mkeller02 right click on defstate. select reslove as... select def.#2021-12-3018:07acim1Perfect! I had been trying to get some option by right-clicking where the warning showed on the name...whoops.#2021-01-0109:13cfleminghttps://twitter.com/CursiveIDE/status/1344934308151136256#2021-01-0216:37noorvirI’m trying to load NPM packages (`@material-ui/core`) into cursive with shadow-cljs as the build tool. I get $package cannot be resolved for every NPM package. As explained in the https://shadow-cljs.github.io/docs/UsersGuide.html#_cursive, I’m using full leinigen integration. The code runs (i.e. shadow-cljs works) but I don’t get any code completion because cursive cannot resolve NPM packages. Any Idea how to configure this?#2021-01-0219:28cflemingSadly, Cursive does not currently understand NPM packaging. It’s on my shortlist to fix, I had hoped to have it in there by now but it hasn’t made it yet.#2021-01-1113:38noorvirThanks for the reply @U0567Q30W. Is there an issue tracking this? Or is there an expected timeline for this?#2021-01-0701:38tony.kayIn Cursive (prior and latest stable) I have a forked version of specter…which has CLJC files. The nav ns pulls macros out of core and the core ns requires nav. Cursive mis-detects a ns loop in this condition and won’t let me load nses that use it. Is there a hack in place for regular specter? (i.e. I made a fork with new namespace names to prevent dependency conflicts). My version runs fine, but the REPL integration is hosed and refuses to load.#2021-01-0807:16cflemingI’m not sure about this sorry. I’m actually away with my family right now, but I’ll look at this ASAP when I’m back.#2021-01-0807:27cflemingI’m planning to make that check less aggressive, because it currently incorrectly catches cases which are not actually problematic.#2021-01-0817:46tony.kayok, thanks. Yeah, I’d rather just get the error from the REPL if possible when it has proven a problem. But perhaps that is a problem because of what you do to integrate, etc. Thanks!#2021-01-0701:39tony.kayhttps://github.com/redplanetlabs/specter/blob/master/src/clj/com/rpl/specter.cljc#L30
https://github.com/redplanetlabs/specter/blob/master/src/clj/com/rpl/specter/navs.cljc#L3#2021-01-0701:39tony.kaythose are the offending lines that cause the error#2021-01-0701:39tony.kay(but I don’t remember ever getting those when I use raw specter)#2021-01-0915:57gabrieleEDIT:
fixed by upgrading intellj to the latest version :man-shrugging:
------
after i updated cursive (i was behind several versions) something changed with the formatting, if i write
(defn test |
and press enter where | is it doesn't indent by two like i would expected
(defn test
|
but
(defn test
|
it's driving me mad, any suggestions?
cursive version: 1.10.1-eap1-2020.1
IntelliJ IDEA 2020.1.2 (Ultimate Edition)
Build #IU-201.7846.76, built on June 1, 2020#2021-01-0917:44emccueHow hard would it be to write an intelliJ plugin that displays a horizontal line directly above every top level form in a namespace (except the ns declaration)#2021-01-0917:44emccueAsking here because idk if there is some part of cursive i can "hook in to" to make it easier#2021-01-0917:45emccueand also because this is the place where intelliJ using people be#2021-01-0919:04emccueActually - intelliJ has a setting called "show method seperators"#2021-01-0919:05emccuebut trying it out it doesn't seem like it plays well with cursive#2021-01-0919:07emccue"that please"#2021-01-0919:41cflemingSure, if you could file an issue I’ll look at making Cursive obey that.#2021-01-0921:59emccueWill do - thanks for the responsiveness you're a gentleman and a scholar#2021-01-0922:45emccuehttps://github.com/cursive-ide/cursive/issues/2483#2021-01-1020:30cflemingThanks! I’m currently doing support from a caravan, but when that is no longer the case I’ll fix that.#2021-01-1220:28agata_anastazja (she/her)Edit: solved 😊
Hello, I have a question around repl set up in intellij with the cursive plugin.
I used the `lein new app app_name` command, and can run the app from my terminal. I haven’t changed anything at all in the scaffolded app.
When I try to run the repl, I get
Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
and all the function names in the text editor are highlighted as not resolved. Any idea what might be causing that?#2021-01-1220:29agata_anastazja (she/her)For the record, I also asked in beginners channel#2021-01-1307:11cflemingHow did you set your project up? Did you do something like this?: https://cursive-ide.com/userguide/leiningen.html#import-an-existing-leiningen-project#2021-01-1307:12cflemingIf you open your Leiningen toolwindow, do you see your project registered there? If not, you can right click on your project.clj and select “Add as Leiningen project”, that should help.#2021-01-1310:06agata_anastazja (she/her)I eventually did click on “Add as Leiningen project” from intellij file tab#2021-01-1501:15cflemingDid that fix the problem?#2021-01-1513:38agata_anastazja (she/her)yes, thank you!#2021-01-1221:55dvingoWhen I paste inside a string "\n" characters are added instead of actually inserting newlines. Is there anyway to disable this (I want the newlines, not the character "\n")#2021-01-1222:06isakNot sure, but the best workaround I've found is to do "Paste as Plain Text" instead of normal paste : Ctrl - Alt -Shift - V#2021-01-1222:14dvingothanks - that works for me#2021-01-1508:30Shantanu KumarIs it possible to have Cursive discover vars (for the purpose of jump-to-definition) defined using macros other than def, defonce and defn? I have connected Cursive via REPL, but that doesn’t seem to have any effect on discovery.#2021-01-1518:12tanzoniteblackmy understanding is that cursive doesn't use any information from the repl for jump to source and other similar things. it's all through static analysis.
if your macro for defining is something that directly maps to similar definitions as def or the others (i.e. something like (my-def-macro my-var-name ...), you can resolve it as def https://cursive-ide.com/userguide/macros.html#customising-symbol-resolution#2021-01-1519:17Shantanu KumarThanks, @U236LQYB0#2021-01-1706:43popeyeI have installed intellj community edition and added cursive plugin , But I am not able to sync my file after starting repl,
anyone faced same issue earlier?#2021-01-1707:09salamcan you be more specific with what you meant by “sync”? #2021-01-1710:17popeyeI was using wrong option, now loaded with namespace and it worked fine#2021-01-1812:23Robert MöstlHello!
Is there a way to disable structural movement in Cursive?#2021-01-1812:44Robert MöstlOr how do Cursive users navigate from word to word in multi-word string literals?#2021-01-1813:06imrehere's an earlier comment of mine about the topic#2021-01-1813:06imre> Just checked this. It seems both cmd+sidearrow and alt+sidearrow (on a mac) are bound to cursive's structural editing move forward and move backward actions out of the box. As I use cmd+arrow for those, I unbound alt+arrow and it now works the way you describe#2021-01-1813:06imreFrom this thread https://clojurians.slack.com/archives/C0744GXCJ/p1610431219018800#2021-01-1814:19Robert MöstlThanks @U08BJGV6E and @UCCHXTXV4#2021-01-1912:47Shantanu KumarWhen I run a unit test in Cursive, the (large) diff output comes all in one line. Is it possible to pretty-print the diff so that I can inspect the details easily?#2021-01-1912:51Shantanu KumarIn clicked on <Click to see difference> to get at the diff window.#2021-01-2016:40Jeff EvansIt seems that the lein plugin doesn’t like this :profiles section too much (I suppose the nested content): https://github.com/metabase/metabase/blob/master/project.clj#L188
Notice the “profiles” detected here: https://imgur.com/a/7MvcfoO
Anyone else seen something like this before?#2021-01-2100:59cflemingHmm, there’s definitely something odd going on there, I’ll take a look when I’m back at my computer.#2021-01-2116:15Jeff Evansthanks. I could also create a GitHub issue if that’s more helpful#2021-01-2223:41cflemingThat would be great, thank you.#2021-01-2515:30Jeff Evansopened https://github.com/cursive-ide/cursive/issues/2487; thanks#2021-01-2117:08Jordan Robinsonhey there, at the minute in cursive when I try and use httpkit.client I get a warning that it can't resolve the functions. I had a quick look into it and it looks like it might be because httpkit uses a macro to generate the functions under client. Is it expected that cursive wouldn't figure them out?
It's a minor annoyance but it would be nice to have autocomplete on these if possible.
This is the bit of httpkit with the macros: https://github.com/http-kit/http-kit/blob/master/src/org/httpkit/client.clj#L297
and please see attached image for what cursive says about it#2021-01-2117:12markaddlemanI just ran into this yesterday. I resolved by instructing cursive to resolve defreq as declare#2021-01-2117:12Jordan Robinsonah that would be good! Could I ask where I would instruct cursive to do so?#2021-01-2117:12markaddlemanNot a perfect solution but it keeps cursive from generating warnings#2021-01-2117:14markaddlemanSure. Go to defreq macro definition. Put the cursor on defreq and do an alt-enter#2021-01-2117:14markaddlemanYou'll get a popup menu with an option for "Resolve defreq as..."#2021-01-2117:14markaddlemanSelect "Specify"#2021-01-2117:14markaddlemanand choose declare from the next menu#2021-01-2117:15markaddlemanI'm giving these instructions from memory. If they aren't right, lmk#2021-01-2117:17Jordan Robinsonthat did it, thanks very much! 🙂#2021-01-2212:02GGfpcHello! Cursive is telling me that defn cannot be resolved in a cljc and cljs project, but only in the cljs files.
Here is my deps.edn
{:paths ["src"]
:deps {
clj-http/clj-http {:mvn/version "3.11.0"}
org.clojure/data.json {:mvn/version "1.0.0"}
reagent/reagent {:mvn/version "1.0.0"}}}
and my shadow-cljs.edn
{:deps true
:dev-http {8081 "public"}
:source-paths ["src"]
:builds {:app {:target :browser
:output-dir "public/js"
:asset-path "/js"
:modules {:main {:init-fn [mate-heatmap.index.render]}}}}}
Not sure what's causing this, I tried deleting the .idea folder and reimporting already#2021-01-2212:59aratareseems like you don't have clojurescript itself in deps.edn?#2021-01-2213:09GGfpcwow I'm dumb haha#2021-01-2213:09GGfpcthanks, that fixed it#2021-01-2213:27thhelleryou are missing shadow-cljs too#2021-01-2213:27thhellerwhich would bring in cljs#2021-01-2217:48Kari MarttilaI guess you guys in this channel might be interested in reading
https://www.metosin.fi/blog/metosin-favorite-editors/#2021-01-2319:47cflemingThanks, very interesting indeed!#2021-01-2217:50Kari MarttilaI counted some statistics:
Which editors Metosinians like to use (one or more):
• Cursive: 11
• Emacs: 5
• Vim: 2
• Eclipse: 1
• VSCode: 3
#2021-01-2217:50Kari MarttilaParedit or parinfer?
• paredit: 13
• parinfer: 1
• something else: 1#2021-01-2314:45Kari MarttilaI'm wondering why the "Use port from nREPL file" selected option won't stay. If I start IDEA/Cursive and start the Clojure REPL and I have chosen "Specify custom port file" the previous time it will be changed to "Use standard port file" the next time.#2021-01-2315:53dpsuttonJust a guess but you’re selecting on of the standard files so it’s reverting back to that choice. If you put a non standard file there does it persist?#2021-01-2317:11Kari MarttilaIf I'm implementing a full stack app (both Clojure backend (.nrepl-port) and Clojurescript frontend (.shadow-cljs/nrepl.port)) there occasionally has been some hassle which file is chosen - therefore I'd like to make it explicit here.#2021-01-2319:48cflemingHmm, I think @U11BV7MTK might be right about the default value - I’ll try to reproduce this.#2021-01-2317:16dpsuttonMakes sense.#2021-01-2415:21ikitommiCursive seems to have issues understanding defprotocol and extend-type (maybe others) syntax when using reader conditionals. Cosmetic, but still. Below some valid code:#2021-01-2522:33cflemingThis is a problem with the parsing due to the reader conditional - I’ll have a look at that and see if I can fix it.#2021-01-2515:54katox@ikitommi there is a meta-issue on related issues already, https://github.com/cursive-ide/cursive/issues/2289
I'd also like to see the priority go up a bit, the first issue is from 2014 so no fingers crossed.#2021-01-2522:29cflemingThanks for that list, I will try to get to these sooner rather than later. @ikitommi’s issue is different though, that’s caused by the parsing not handling the reader conditional correctly.#2021-01-2607:55cfleminghttps://twitter.com/CursiveIDE/status/1353974663416692737#2021-01-2607:55cfleming(in reply to https://twitter.com/CursiveIDE/status/1349889139534032897)#2021-01-2609:28Rachel Westmacottis it known that :deps and :extra-deps in deps.edn files get autocomplete/intelligent suggestions on version numbers, but :replace-deps doesn't?#2021-01-2614:06Rachel Westmacottannoyingly olical/depot doesn't understand :replace-deps either, but I've fudged around both:
:aliases {:outdated {:replace-deps {}
:extra-deps {olical/depot {:mvn/version "2.1.0"}}
:main-opts ["-m" "depot.outdated.main" "--every" "--write"]}}#2021-01-2614:07Rachel Westmacottnow I get to avoid all the project dependencies just to run a tool, and I get auto-suggestions in Cursive, and I get auto-updated dependencies in CI 😄#2021-01-2620:42cflemingI wasn’t aware of that, no, but it does indeed seem to be the case! Can you file an issue for that, and I’ll get it fixed?#2021-01-2621:25cflemingActually, never mind, I filed https://github.com/cursive-ide/cursive/issues/2490#2021-01-2622:26Oliver GeorgeQuick sanity check. Should Cursive play nicely with IntelliJ 2020.3#2021-01-2622:26cflemingYes!#2021-01-2622:27Oliver GeorgeTa.#2021-01-2622:28Oliver GeorgeHere's a screenshot in case you say "ah, try x"#2021-01-2622:29Oliver George#2021-01-2622:29Oliver Georgens alias stuff working. intenting borked....#2021-01-2622:29Oliver Georgehiglighting all over the show.#2021-01-2622:50cflemingTry this: https://cursive-ide.com/userguide/eap/troubleshooting.html#help-lots-of-symbols-don-t-resolve#2021-01-2622:58Oliver GeorgeThanks. Worked it out. I'm a goose.#2021-01-2622:59Oliver GeorgeIn case you see this again. My deps.edn didn't include clojurescript directly. I have to specify an alias to pick it up. I guess that without the alias CLJS namespaces didn't have cljs.core namespace available.#2021-01-2622:59Oliver GeorgeHere's our deps.edn for reference
{:paths ["src" "test"]
:deps {reagent {:mvn/version "0.10.0" :exclusions [cljsjs/react cljsjs/react-dom]}
re-frame {:mvn/version "1.1.0"}
day8.re-frame/async-flow-fx {:mvn/version "0.1.0"}
datascript {:mvn/version "1.0.1"}
datascript-transit {:mvn/version "0.3.0"}
com.cognitect/transit-cljs {:mvn/version "0.8.256"}
condense/cljsrn-react-native-community-datetimepicker {:sha "e19943aaccbde0a2285d654f43846bb960dc7090" :git/url ""}
condense/cljsrn-react-native-community-geolocation {:sha "6f89fc4f39cf720ef1216783d9b0bb063710d3aa" :git/url ""}
condense/cljsrn-react-native-community-netinfo {:sha "9cb857ad9fb94bd79e1c28259b745c85f18acb00" :git/url ""}
condense/cljsrn-react-native-elements {:sha "3fc1767c10da63a185cf58656c7fb6a39f0ddf50" :git/url ""}
condense/cljsrn-react-native-image-picker {:sha "f5069504fd5d3b8ba37a01725f7d12c349cf204d" :git/url ""}
condense/cljsrn-react-native-sqlite-storage {:sha "2cc6ba2ba16d7dfd4851618528bb3928babd429a" :git/url ""}
org.xerial/sqlite-jdbc {:mvn/version "3.28.0"}
org.clojure/java.jdbc {:mvn/version "0.7.10"}
com.cognitect/transit-clj {:mvn/version "1.0.324"}
clj-statecharts {:sha "84708b306c678a37ab5866532950691a7551732e" :git/url ""}}
:aliases {:krell {:extra-deps {io.vouch/krell {:sha "577980ba68eb78bd0e49b93a514af27713c17d44" :git/url ""}
binaryage/devtools {:mvn/version "1.0.2"}
org.slf4j/slf4j-simple {:mvn/version "1.7.30"}}
:main-opts ["-m" "krell.main" "-co" "krell.edn" "-c" "-r"]}
:release {:extra-deps {io.vouch/krell {:sha "577980ba68eb78bd0e49b93a514af27713c17d44" :git/url ""}
org.slf4j/slf4j-simple {:mvn/version "1.7.30"}}
:main-opts ["-m" "krell.main" "-co" "release.edn" "-O" "simple" "-c"]}
:figwheel {:extra-paths ["target"]
:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.773"}
com.bhauman/figwheel-main {:mvn/version "0.2.11"}
binaryage/devtools {:mvn/version "1.0.2"}}
:main-opts ["-m" "figwheel.main" "-b" "figwheel" "-r"]}
:node-repl {:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.773"}}
:main-opts ["-m" "cljs.main" "--repl-env" "node"]}
:browser-repl {:extra-deps {org.clojure/clojurescript {:mvn/version "1.10.773"}}
:main-opts ["-m" "cljs.main" "-r"]}
:masterdata {:main-opts ["-m" "app.masterdata"]}}}#2021-01-2623:00Oliver GeorgeKrell is used for builds. It was (is?) specifying a specific sha for clojurescript and resolution between mvn/versions and :git/url shas was a problem. This was our work around.#2021-01-2623:01Oliver GeorgeOnly thing I think Cursive might have done to help is warn that there was no clojure core namespaces available in the deps path.#2021-01-2623:07cflemingThat might be a good idea, the problem is also guiding people to how to fix it.#2021-01-2623:08cflemingSo did this work in previous IntelliJ versions, and the alias you were syncing got lost in the upgrade somehow?#2021-01-2623:56Oliver GeorgePerhaps just a new entry in that link would be enough to get people thinking. Seems like it's rare so won't be offended if you don't.#2021-01-2623:57Oliver GeorgeNot sure how I got myself out of sync. Most likely I deleted and re imported the project for some reason. Perhaps clearing out the repo killed th impl files or cloning fresh. I don't recall - lots going on.#2021-01-2623:57Oliver GeorgeIt'd be a manual step to add an alias - easy to forget.#2021-01-2701:03cflemingActually, re-reading that doc there is this bit:
> Also, you might have to configure your aliases (for deps) or your profiles (for Leiningen).#2021-01-2701:03cflemingBut it could probably be more visible.#2021-01-2701:54Oliver Georgeah, yep.#2021-01-2716:50Kari MarttilaIs there a way to configure a hotkey so that using that hotkey I could activate either REPL 1 or REPL 2 (e.g. frontend / backend). I develop a full stack app and have both frontend and backend REPLs and jumping in the editor between frontend and backend code and would like to switch the active REPL using a hotkey instead of getting my hand from my dear Dygma Raise keyboard to the mouse and click the "frontend" or "backend" tab:#2021-01-2809:19Kari MarttilaSorry for asking this here, it is IDEA specific and the same command that switches tab in any IDEA window.
So, I have a hot key to switch focus to REPL window, then another hotkey to switch tab, hotkey to jump back to editor.
Case closed.#2021-01-2816:17aratareIt would be nice if we can have a choice of which repl when sending forms.#2021-01-2816:18aratareand evaluating such forms will automatically switch to the repl to show the results.#2021-02-0108:23JoniI have a hotkey for focusing the repl then just switch tabs with ctrl + right/left arrow#2021-01-2720:57Daniel WellmanHello! I’m having problems opening a specific Leiningen project in IntelliJ 2020.3.2 with Cursive 1.10.0-2020.3. When I try to open the project folder (has a project.clj and no .idea folder or .iml) the idea.log has a message: ERROR - .LeiningenProjectOpenProcessor - Error opening project
java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class java.lang.String I just tried creating a brand new Leiningen app and it opened fine, so I suspect there may be something with this specific project’s Leiningen configuration. Any suggestions where I should start investigating? I’ll post the full stack trace in a thread.#2021-01-2720:58Daniel Wellman2021-01-27 14:54:49,532 [1409073] ERROR - .LeiningenProjectOpenProcessor - Error opening project
java.lang.ClassCastException: class clojure.lang.Keyword cannot be cast to class java.lang.String (clojure.lang.Keyword is in unnamed module of loader java.net.URLClassLoader @41915c2f; java.lang.String is in module java.base of loader 'bootstrap')
at cursive.leiningen.project.LeiningenProjectOpenProcessor$getProjectInfo$1.run(ImportProject.kt:466)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:962)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:520)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:79)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:178)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:658)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:610)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:65)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:165)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-01-27 14:54:49,533 [1409074] ERROR - .LeiningenProjectOpenProcessor - IntelliJ IDEA 2020.3.2 Build #IU-203.7148.57
2021-01-27 14:54:49,533 [1409074] ERROR - .LeiningenProjectOpenProcessor - JDK: 11.0.9.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2021-01-27 14:54:49,533 [1409074] ERROR - .LeiningenProjectOpenProcessor - OS: Mac OS X
2021-01-27 14:54:49,533 [1409074] ERROR - .LeiningenProjectOpenProcessor - Plugin to blame: Cursive version: 1.10.0-2020.3
2021-01-27 14:54:49,533 [1409074] ERROR - .LeiningenProjectOpenProcessor - Last Action: WelcomeScreen.OpenProject
#2021-01-2722:23markaddlemanCan you post your project.clj? I'm guessing there is some non-standard data in there. Perhaps Leiningen is not sensitive to it but (obviously) Cursive is#2021-01-2722:28Daniel WellmanIt’s from an open source project that I opened — https://github.com/empear-analytics/codescene-ci-cd/blob/master/project.clj#2021-01-2723:13markaddlemanYeah, I thought I recognized this error. It's because the project is using the "lein-v" Leiningen plugin.#2021-01-2723:13markaddlemanNotice that the version identifier in the project.clj is :lein-v - Cursive expects this to be a string.#2021-01-2723:14markaddlemanNormally, it is but the lein-v plugin allows it to be a keyword (it must play some games under the covers with Leiningen)#2021-01-2813:45Daniel WellmanOh! Thank you for pointing this out — I’ll look into the lein-v plug-in to learn more about that.#2021-01-2816:00Jeff Evansdoes anyone have an IntelliJ code style file that basically implements this? https://guide.clojure.style/
having a hard time making the formatting match what is outlined there#2021-01-2816:01Jeff Evansat a minimum, I had to enable Default to Only Indent, but I still haven’t figure out how to accomplish the https://guide.clojure.style/#one-space-indent part#2021-01-2821:09cflemingI don’t think you want Default to Only Indent for matching the guide. But you probably do want One space list indent.#2021-04-0100:39Alex Miller (Clojure team)The discard sequence is part of edn#2021-04-0100:43Alex Miller (Clojure team)I don’t recognize that error, don’t know what that is#2021-04-0100:43cflemingOk, I’ll try to debug this later and report back.#2021-04-0101:50cfleming@U0AD3JSHL I’m not seeing an error with this. Cursive imports without the CLJS dep but that’s because Deps doesn’t return it, as detailed above. I’m using CLI tools 1.10.3.810.#2021-04-0101:53cflemingThat error seems to be something to do with ssh. Do you have something in your user deps file which might cause deps to do something with ssh? The most likely candidate would be something with git and the new git shell integration, but that’s getting outside the realms of my deps CLI knowledge.#2021-04-0102:00Alex Miller (Clojure team)The error was about Maven so that doesn’t match up#2021-04-0102:02Alex Miller (Clojure team)That deps.edn above is wrong - missing the outer map with :deps key#2021-04-0102:10onetomin the original message the map had a quote, so i assumed it wasn't the whole deps.edn#2021-04-0102:29cflemingUgh, you are absolutely right, I’m not paying attention. If I add the outer map and :deps, both Cursive and CLI do the right thing. I can’t repro the initial error.#2021-04-0106:55heliosyes, sorry, it wasn't the whole deps.edn 🙂#2021-04-0106:55helioswas just the culprit part of a larger deps.edn that worked fine#2021-04-0214:41onetomSo, the matching-paren highlighting seems broken again in the upcoming IntelliJ 2021.1
I've added a comment to the ticket which reported the same error 2 years ago:
https://youtrack.jetbrains.com/issue/IDEA-215291
Would be good to raise awareness of this problem, because it's super annoying in Clojure, where it's very common to have adjacent parens.#2021-04-0419:49cflemingUgh, bummer. I’m away with my family over Easter but will look at this when I’m back.#2021-04-0215:21AdieI have registered cursive with intellij. I now want to run the tests of one of my clojure services. How do I run the tests using cursive?#2021-04-0215:48Daniel WellmanHi Adie, you can either:
1. Use the standard IntelliJ “Run Tests…” option if you have a test file open, which will compile the Cursive code then run the test. If your project takes a while to compile, this is a slower option.
2. However, if you have a REPL session running, you can also run the tests via the Tools > REPL > Run Tests … options (there are few to either run the tests in the current namespace, the test function under the cursor, or re-run the last test command). This test output is put in the gutter/margin of the test source file, unlike the first option which uses the standard IntelliJ test runner. It’s very fast and I try to use this mode all the time.
Here’s some background on the second option: https://cursive-ide.com/userguide/testing.html#2021-04-0216:03mokrHi, after a complete reinstall of IntelliJ 2020.3 + Cursive on MacOS, where I deleted all preference, application support and cache directories as well, I struggle with IntelliJ forgetting what I did in my previous session.
More specifically I get this dialog:
Unindexed remote maven repositories found.
The following repositories used in your projects have not been indexed yet:
If you want to use dependency completion for artifacts in these repositories,
Open Repositories List, select the required repositories and press the "Update" button
You can disable this notification.
I scan both indexes and everything looks good. After a restart I get the same message.
Any ideas?#2021-04-0217:46Jeff Evansmany others in this channel have reported the same (this prompt always appears on restart). I’ve personally seen it too#2021-04-0303:56aratareThis is mainly for autocompletion if I recall correctly. E.g. when you use gradle or maven and you want a library, IntelliJ can help you by autocompleting the proper library.#2021-04-0303:56aratareI just disable this completely since it’s harmless and doesn’t add anything particularly useful.#2021-04-0314:21mokrThanks, good to know that it is not just my setup at least.
I saw Tony Kay use this autocomplete in one of his many great videos on Fulcro, so I was hoping to do the same as part of upping my IntelliJ/Cursive skills.#2021-04-0314:24aratareYou can just follow the instruction in the popup and update it manually. I used to use it for a bit, but found it not really useful because it might find a bunch of libraries with the same name, so I’d still have to go and double check the author anyway.#2021-04-0318:34mokr@U013F1Q1R7G Maybe I wasn’t clear enough, but the “I scan indexes and everything looks good” is that manual step. I’ve manually transitioned them from “never” (indexed) to current time several times, but a restart clears it, triggering the popup once again on the next start. So, IntelliJ has a severe case of amnesia it seems 🙂#2021-04-0403:16aratareMy bad then#2021-04-0216:27isakIs it possible to add custom colors/backgrounds to source code in Cursive/IntelliJ? For example, if I have this keyword in my code, I'd like to change the appearance of text like "mt-2" and "p-2" (Tailwind classes for margin-top and padding) so they are easier to spot.
[:input.mt-1.p-2.border.border-gray-300.rounded-sm.bg-white ...
#2021-04-0419:50cflemingI don’t think there’s any good way to do this, sorry. The issue is that those classes are just part of a normal keyword, even identifying them as hiccup isn’t totally trivial.#2021-04-0514:59isakAh, ok :thumbsup::skin-tone-2:#2021-04-0416:37indyWow, one more tailwind feature request. The jetbrains tailwindcss plugin has autocomplete/suggestions for tailwind classes when adding it to an HTML tag's class attribute. Can this be extended to hiccup?#2021-04-0419:51cflemingThe problem here is since It’s All Data, it’s hard to reliably identify what’s hiccup and what’s not.#2021-04-0420:45indyRight. There doesn't seem to be any action to manually invoke the suggestions. Is it possible to do that? But I guess that is IntelliJ's realm?#2022-10-2000:57Jared LangsonThis is also a feature I am interested in. Regardless of if it requires manual invoking, it would still be useful. @U0567Q30W#2021-04-0517:42cbchello, i'm new and i'm trying to use shadow-cljs with cursive, is it possible to get command completion for js libraries that were installed via NPM? i'm currently using the pom.xml, as detailed here: https://shadow-cljs.github.io/docs/UsersGuide.html#_cursive#2021-04-0615:59bbqbaroni’ve found cursive + lein checkouts to be a little unpredictable. it seems sometime as if there’s some hidden state, or there’s something i’m very subtly doing wrong/differently in each case. does anyone else have data on this? tips/arcana?
it unfortunately seems to boil down to “sometimes it works and sometimes it doesn’t”, which i know isn’t very useful. when it doesn’t work, i don’t get errors. rather, it seems as if the checked-out project is added to my intellij workspace (such that its namespaces show up when opening a namespace — twice, in fact — and its files are in my left-hand Project display pane). weirder, changing the checked-out source does change the REPL behavior. cursive, however, goes to my .m2 jar, if any, when asked to jump to the definition of the checked-out code, and, when i open the source files from the checked-out project, cursive is not willing to reload them, with It is not in scope for the module used to start the REPL.#2021-04-0615:59bbqbaronif any of this is familiar, any info would be great!#2021-04-0616:01bbqbaronFWIW, the checked-out project seems to be added to my intellij state by cursive, so it does, fundamentally, recognize that checkouts exist. it’s not just blithely ignoring them such that they only have any effect on the lein repl itself.#2021-04-0706:44heliosIs there a way to have cursive be able to resolve babashka projects? For example, babashka.curl and other namespaces are always unresolved#2021-04-0707:35heliosor js stuff?
https://cln.sh/MgHBrt#2021-04-0707:35helios(or at least to not complain about those)#2021-04-0707:40borkdudeYou can add a deps.edn with these libs #2021-04-0901:57cflemingThere isn’t a way to get this to work automatically at the moment, sorry - I’m planning to add an SDK type which will help with this.#2021-04-0901:57cflemingThere’s an issue discussing problems with bb: https://github.com/cursive-ide/cursive/issues/2516#2021-04-0714:18R.A. PorterI see that IJ 2021.1 is released. I used to be aggressive about upgrading and often ran on the EAPs, but because they like to make little changes that break Cursive I’ve become much more gun shy. Were the betas/RCs running well with Cursive so that I can assume it’s safe to upgrade today, or would it be better to wait a few weeks?#2021-04-0714:54imreI haven't upgraded yet as a few other plugins I use aren't compatible yet. However there was this a few days ago: https://clojurians.slack.com/archives/C0744GXCJ/p1617374485142900#2021-04-0718:44salami just upgraded intellij idea to 2021.1 and got the java.lang.Throwable: Non-idempotent computation: it returns different results when invoked multiple times or on different threads exception as a pop-up notification when opening every existing deps.edn project. i'm not sure if it breaks anything but figured i should report it here in case Colin is interested in fixing it (stacktrace attached).#2021-04-0719:16rcruppI upgraded to 2021.1 also and my remote repl configuration stopped working. Error stated that "REPL run configuration is incorrect - no module selected" when I attempted to run it.#2021-04-0719:40rcruppLike all things, it works now after invalidating the project caches and restarting#2021-04-0902:24cflemingI’ve been using 2021.1 since the start of the EAP and it’s been working well for me. The idempotence check isn’t new in 2021.1, that’s been there for a while now.#2021-04-0902:31salami see. i am greeted with this error message whenever i open an existing deps.edn project. it would be nice it didn't show up in the first place if it doesn't have any impact on the functionality/stability of the ide/cursive.#2021-04-0902:37cflemingYes, this is unfortunate, and I’m not sure what the implications are since it doesn’t seem to affect anything that I can see. Fixing it is also a significant engineering effort at this stage. I’m going to talk to JetBrains about it and see if I can disable the message in the meantime.#2021-04-0714:49Ilari TuominenI just updated and then remembered that I haven’t bought a new Cursive license, I can safely say that Cursive 1.10.0 does not work with Idea 2021.1. Is upgrading cursive the only path for me now?#2021-04-0901:59cflemingRight, 2021.1 support was added in 1.10.1. You’ll have to upgrade Cursive in that case, yes.#2021-04-0715:07Endre Bakken StovnerIn IdeaVIM, how can I make * search for the whole term? Currently, if the cursor is above create in create-jobs it looks for create not create-jobs.#2021-04-1403:05kendall.buchananI’ve wondered the same thing :man-shrugging:#2021-04-1819:53seriogaConfigure iskeyword#2021-04-2316:29Endre Bakken StovnerDanke!#2021-04-0715:08Endre Bakken StovnerIs there a refactoring that allows me to rewrite (deeply (nested (function calls))) into (-> (function calls) nested deeply)#2021-04-0715:14imrethread form and unthread form#2021-04-0715:53Endre Bakken StovnerThanks!#2021-04-0719:35Kari Marttilahttps://blog.jetbrains.com/idea/2021/04/intellij-idea-2021-1/ => is it safe to install (i.e. will Cursive work with this new version)?#2021-04-0719:36Kari MarttilaAah, someone already tried... maybe not yet installing it. 😀#2021-04-0719:48Jeff EvansI have two machines so I’ll be a guinea pig on one of them#2021-04-0720:04Jeff Evansfirst observation: Recent Projects disappeared#2021-04-0720:04Jeff Evansalthough that may happen with every major update. I can’t remember#2021-04-0720:09Jeff Evansand my Cursive specific keyboard shortcuts disappeared 😞#2021-04-0720:11Jeff Evansalthough IntelliJ sync restored those, phew#2021-04-0810:33onetomi haven't experienced any of those issues. (im on latest macOS Big Sur 11.2.3 (20D91) and cursive 1.10.2-eap2-2021.1)#2021-04-0810:36onetomthe paren highlighting has definitely changed back to that undesirable state where it was in 2018 😞
if my caret is at the position of | in an expression like (xxx (yyy)|), then the 1st open paren is highlighted, instead of the 2nd open paren as the matching one.#2021-04-0810:48onetomim getting some cursive exceptions though, but those seem to be the same one i was getting on earlier versions of intellij too, so i think it's specific to my actual project.
for the record, here is the exception:
java.lang.Throwable: Non-idempotent computation: it returns different results when invoked multiple times or on different threads:
class cursive.psi.impl.synthetic.ClJavascriptAlias != class cursive.psi.impl.synthetic.ClNamespaceAlias
which is class of Namespace alias http (org.httpkit.client) and Namespace alias http (org.httpkit.client)
which is element of
#2021-04-0902:01cfleming@U086D6TBN I’m not seeing that paren problem, it’s working fine for me and no-one else has reported that.#2021-04-0902:01cflemingAnd yes, the non-idempotent thing is an ongoing problem, not 2021.1 specific.#2021-04-0902:36onetomgreat to hear that the paren thing is not reproducible. most likely it's caused by some plugin then!
i will do some bisecting on my plugins!#2021-04-0902:37cflemingI’m interested to hear if you figure out which one it is!#2021-04-0918:22wilkerlucioone more data point: to me the parens are working as expected#2021-04-0919:08wilkerlucioone very subtle detail I noticed (maybe not from the last IntelliJ, but using Intellij with BigSur): the cursor, specially the Text cursor, seems like instead of having the “clicking point” in the middle (as it is in the rest of the OS) it is positioned at the top left corner of the icon (like if it was a pointer cursor)#2021-04-0919:09wilkerluciodid anybody else experience that? I noticed this after having a bunch of selections that I though I was starting at a specific char, but off by one, many times#2021-04-1011:40octahedrionquick documentation is broken for me since the update: colour scheme doesn't follow dark mode, and popup randomly shows up as docked then stops showing at all until restart#2021-04-1014:24octahedrionreverted#2021-04-1205:21onetom@U0567Q30W i've just installed an IntelliJ CE 2021.01 from scratch and only added Cursive stable as a dependency and the highlighting works as expected.
I've upgraded Curisve to 1.10.2-eap2-2021.1 and highlighting still works.
On my main config, even after removing the Rainbow Brackets plugin, the highlighting is still buggy.
Here is my IntelliJ config, with all the plugins listed at the end.
Maybe having a glance over them would give u an idea which one might interfere with Cursive:
IntelliJ IDEA 2021.1 (Ultimate Edition)
Build #IU-211.6693.111, built on April 6, 2021
Licensed to Tamas Herman
Subscription is active until November 26, 2021.
Runtime version: 11.0.10+9-b1341.35 x86_64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
macOS 11.2.3
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 16
Registry: ide.allow.merge.buttons=false, ide.settings.move.mouse.on.default.button=true, suppress.focus.stealing.disable.auto.request.focus=true
Non-Bundled Plugins: AceJump (3.7), IdeaVIM (0.66), Key Promoter X (2021.1.1), Org4Idea (0.4.1), Shell Process (1.3.2), YAML/Ansible support (0.11.2), com.4lex4.intellij.solarized (2.3.0), com.intellij.plugins.watcher (211.6693.44), com.paperetto.dash (3.3), de.dieploegers.develop.idea.shellfilter (3.0.3), de.netnexus.camelcaseplugin (3.0.8), io.protostuff.protostuff-jetbrains-plugin (0.13.0), nix-idea (0.3.0.6), org.intellij.RegexpTester (1.0.8), org.jetbrains.plugins.localization (211.6693.44), org.jetbrains.plugins.rest (211.6693.44), mobi.hsz.idea.gitignore (4.0.4), name.kropp.intellij.makefile (211.6693.108), AWSCloudFormation (211.6693.108), org.plugin.dot.id (1.2), org.toml.lang (0.2.144.3766-211), com.github.pshirshov.bytecodeeditor (0.2.1), zielu.gittoolbox (203.5.3), com.intellij.plugins.html.instantEditing (211.6693.111), com.cursiveclojure.cursive (1.10.2-eap2-2021.1), com.jetbrains.plugins.jade (211.6693.65), com.dmarcotte.handlebars (211.6693.44), PlantUML integration (5.1.0), Pythonid (211.6693.115), aws.toolkit (1.25-211), net.ashald.envfile (3.2.1), ru.meanmail.plugin.requirements (2021.3-211), org.asciidoctor.intellij.asciidoc (0.32.35)
Kotlin: 211-1.4.32-release-IJ6693.72
#2021-04-0722:03Lone Rangerhail mary: there's no chance Cursive has a cljs debugger, is there?#2021-04-0902:04cflemingSadly, no, sorry.#2021-04-0917:02Lone RangerNo worries. Seems really elusive thinking-face#2021-04-1011:50gscaccoHi all. If I select some part of a s-expression including parenthesis (even not balanced) and press del, cursive deletes the selection generating a not-balanced s-expression. From here I can't find any way to re-balance parenthesis. Is there a way to solve this problem ? Thanks#2021-04-1011:56raspasovDon’t select expressions manually; I personally use “Extend Selection”#2021-04-1011:57raspasov(with a keyboard shortcut attached, ofc)#2021-04-1012:03gscacco👍#2021-04-1012:06simongrayuse parinfer#2021-04-1014:41dpsuttonIf using paredit you can insert a new balanced pair of parens and then highlight and delete one to leave you with the desired paren to help balancing. But the advice to never get into this state is the more correct way to manipulate forms#2021-04-1014:46simongrayAll I know is that as long as I keep auto-indenting while using parinfer, I can quite casually highlight and delete most stuff and It Just Works(tm) 😉#2021-04-1108:47armedSometimes I manually select closing paren, copy it to buffer and paste somewhere else to achieve balance. I know it’s dirty technique, but works. #2021-04-1207:56katoxthe dirty solution to unbalanced parens with cursive paredit is just copying and pasting closing parens#2021-04-1213:16raspasovIn addition to “Extend Selection” + backspace, you can also simply “backspace”; With paredit (what I use) it always does the right thing (at least from my perspective); But I agree coming from another language it can be tempting to hold Shift + arrow keys to select portions of the code; Just don’t 🙂 It can take a few weeks to break that muscle memory;
I’ve forgotten those times so much that now it’s super hard to code without at least “Extend Selection” in another language; For example, XCode doesn’t have “Extend Selection”, so if I have to write Swift, I use AppCode (by IntelliJ) and use Extend Selection, copy/paste/delete all the time (since there’s no easy+proper structural movement).#2021-04-1315:44Endre Bakken StovnerHow do you comment a form in cursive?#2021-04-1315:45imre#_#2021-04-1315:45imreThis applies to all of clojure, not only cursive though#2021-04-1315:45imreSo I might have misunderstood your question#2021-04-1315:46Endre Bakken StovnerAh, so there is no comment form like in emacs.#2021-04-1315:47imreThere isn't an intellij action for it, no#2021-04-1315:47imreThere's an open issue however https://github.com/cursive-ide/cursive/issues/1047#2021-04-1315:58Endre Bakken StovnerGood to know!#2021-04-1316:01Jeff EvansI mean, the block comment action works. It just prefixes all the lines which isn't always nice. Parinfer does the right thing though#2021-04-1316:06imreHmm. block comment action is disabled for me no matter whether I'm in paredit or infer#2021-04-1316:06Jeff EvansThat's strange... I'm using it on a regular basis#2021-04-1316:07Jeff EvansVia the keyboard shortcut anyway#2021-04-1316:13imredo you have anything selected when you invoke it?#2021-04-1317:29Jeff Evanswell yeah… I don’t see how else you’d use it#2021-04-1317:30Jeff Evanspushing ⌘/#2021-04-1317:58raspasovYou can record an IntelliJ macro (nothing to do with Clojure macros) https://stackoverflow.com/questions/9638895/rubymine-shortcut-to-insert/9639266#9639266#2021-04-1317:58imreThanks for the explanation. Although I believe that still triggers the line comment action#2021-04-1317:58raspasov(before 1. make sure you’re actually inside an Sexprs)
1. Edit | `Macros` | `Start Macro Recording`#2021-04-1317:59raspasov2. Navigate | Structural Movement | Move backward out of Sexpr#2021-04-1318:00raspasov3. Type #_ whenever the cursor is (should be at the beginning of an Sexprs)#2021-04-1318:00raspasov4. Edit | `Macros` | `Stop Macro Recording`#2021-04-1318:00raspasov5. Give your “macro” a name#2021-04-1318:01raspasov6. Go to Keymap and assign a keyboard shortcut for it#2021-04-1318:01raspasovJust tried it, it works! It’s a nice idea.#2021-04-1318:01raspasovYou can be anywhere inside an Sexprs, press your shortcut, and comments out the whole form via #_#2021-04-1318:07raspasovYou can add “Format Code” as a last action of your macro, then it looks even better 🙂#2021-04-1413:55Endre Bakken StovnerThanks!#2021-04-1315:44Endre Bakken StovnerComment out that is#2021-04-1317:42Phil ShapiroI use comment. It’s not specific to cursive but works very well. https://clojuredocs.org/clojure.core/comment#2021-04-1418:49wilkerluciohello, I’m having a strange issue, on the latest cursive and intellij, trying to do a rename, but the IDE is stuck at “Looking for usages”, its been like that for many minutes now#2021-04-1418:56wilkerlucioWhen I do a regular Find Usages on the same keyword, I got some partial results, and the search never ends#2021-04-1418:56wilkerluciowith other keywords it works fine, seems like the name name is part of the problem#2021-04-1419:06Jeff Evansit’s my observation that the rename refactoring is paranoid/finds too many references, especially for “common” names like that#2021-04-1419:06Jeff Evansnot just in Cursive, but even in the built-in Java world#2021-04-1419:06wilkerlucioyup, small names are horror for refactorings 😛#2021-04-1419:07wilkerluciobut even when it takes long, it eventually finishes#2021-04-1419:07wilkerlucioin this case, it seems to always get stuck at the same place, I guess there is some bug, something broke there, and then it got stuck =/#2021-04-1419:23jacekschaeif you didn’t already try to exclude some folders, this help me with the same thing you are experiencing#2021-04-1419:26wilkerlucioall compiled things are excluded, I also trying doing a find usages limiting the scope (I made a custom scope and ensure I only had clj sources), but still the same result#2021-04-1419:26wilkerlucio(its around 30 min running now, and not finishing)#2021-04-1421:03cfleming@U066U8JQJ What are you trying to rename? A symbol/keyword/something else?#2021-04-1421:09cflemingCould you take a thread dump and mail it to me? https://intellij-support.jetbrains.com/hc/en-us/articles/206544899. I suspect it will show “somewhere in the bowels of IntelliJ” but you never know.#2021-04-1514:04wilkerlucio@U0567Q30W sent#2021-04-1604:59baibhavbistaHello, I had a question regarding using Ultimate vs Community version of IDEA with Cursive. Does anyone know what (if any) features I will not get if I use the community version?
Would love answers about what features you all regularly use that would not be possible in the community version.#2021-04-1605:45cflemingThere are no Cursive features that require the Ultimate edition at the moment. Obviously you would not have the IntelliJ features (web stuff is probably the main one people miss) but Cursive will be exactly the same in both.#2021-04-1605:45cflemingThat may change in the future, especially around better JS support for CLJS, but that’s still unknown at this point.#2021-04-1606:59baibhavbistaThank you for the clear answer 😄#2021-04-1618:28raspasovUltimate has nicer support for exploring JS stuff around React, etc. Been using Ultimate for a couple of years, but as far as I remember the Community didn’t “understand” JS files very well or at all. If you just focus on server side Clojure, you’re just fine with Community most likely (since Community has almost identical pure Java support with Ultimate, as far as I remember).
I would start with Community and see if you miss anything. Relatively painless to upgrade.#2021-04-1618:30raspasovYou should be able to copy over your custom settings, etc over to Ultimate without much issue. I don’t recall any problems.#2021-04-1620:07imre@cfleming I read that there's a new version out but my intellij doesn't seem to see it. I'm on 1.10.2-eap2-2020.3#2021-04-1620:20imretried checking for updates a number of times but no luck#2021-04-1903:41cflemingHmm, I'm not sure - I just checked the repo page, and it should definitely be there even for EAP users.#2021-04-1909:38imreThanks for checking. Managed to update now via idea properly#2021-04-1621:54kennyIs there a Cursive setting that lets you have autocomplete prefer (or only) use unaliased keywords even if an alias for that ns exists?#2021-04-1903:41cflemingThere isn't at the moment, but it's something I've considered.#2021-04-1915:21kennyI’ve really started to dislike aliases for keywords. The only alternative is to type the whole thing out. It’d be great to have this as an option 🙂#2021-04-2023:00cflemingI'm curious - why don't you like them?#2021-04-2200:10kennyThey tie data to code. Copy pasting code does not work. Renaming a namespace breaks all keywords (bad if that data went into a DB).#2021-04-2200:11kennyI've started to think of them as an anti-pattern.#2021-04-2200:12kennyIt's really hard to move away from it when autocomplete so strongly wants me to use them, haha.#2021-04-2200:28cflemingInteresting. I’m actually planning to fix the copy paste issue, for keywords and also for symbols referring to vars. In the case of data, systems wouldn’t store them as aliased anyway normally, would they? I’d assume they’d be using a semantic kw object with ns and name parts. The alias thing is really just a reader shortcut, and doesn’t exist in e.g. EDN.#2021-04-2200:30kennyIt is recommended for all data stored in Datomic to be qualified keywords. Data is inputted and outputted in keywords.#2021-04-2200:30cflemingSure, but what I mean is that Datomic won’t store it with the alias, it’ll store it with the full ns/name combo, right?#2021-04-2200:31kennyOh, haha. Yes - that is correct. The reader always expands first.#2021-04-2200:35kennyIt still seems to be mixing my data with my code. I have no need to require a namespace simply to refer to my data (I'm assuming that's the thought on how to fix it). I only want to work with the data.#2021-04-2200:56cflemingI’m not proposing a solution, just trying to understand the problem better. Is there a case where the aliasing causes a problem? I get the copy/paste issue. Renaming namespaces shouldn’t be a problem, renaming aliases might if Cursive doesn’t handle that properly.#2021-04-2619:33kennyThis isn’t a problem with Cursive, just aliases. I don’t like that it’s depending on the context of the namespace. Since it’s just data, I prefer to have it be exactly that — no implicit context involved. #2021-04-1800:41Joe R. SmithI've noticed for some time now that Cursive's pretty printed REPL output is really narrow, e.g.:
([:db/retractEntity
[:reminder/id
#uuid"2f2c5f85-f0e4-4aea-b1e9-de0c6d51d19b"]]
[:db/retractEntity
29827551438457744]
[:db/retractEntity
36429019251607655])
Is this configurable somewhere?#2021-04-1800:41Joe R. Smithanother more extreme example:
[1
2
3
4]
#2021-04-1903:47cflemingThat seems strange, and is definitely not what I'd expect. Is this with an nREPL REPL? What is your editor right margin set to? Sorry, my computer is in the shop so I can't look up the exact setting.#2021-04-1920:07Joe R. SmithYes, it's an nREPL REPL#2021-04-1920:09Joe R. SmithAnother data point- it only does this on my Apple Silicon Mac Mini w/ the ARM build of IntelliJ. I'm not at home right now so I can't check versions, but will when I get home.#2021-04-2009:00cflemingHmm, that's tricky - I don't have an Apple Silicon machine to repro on. I may well have one soon though, if my computer is actually dead.#2021-04-2106:47golanweissHi, I’m using deps,
and each time after initial project scanning, Cursive overrides my definitions for my modules’ source root, test root, resources etc.
Seems it takes what is in the deps.edn under :paths and marks each of them as source root.
Is this a known issue? is there a workaround?#2021-04-2107:25cflemingNo, that's how it should work, and it's also how all the other integrations (e.g. Maven) work. If you're using a build integration to manage your module, then you need to put the config into your module file (deps.edn in this case) and that will be reflected in the IDE setup.#2021-04-2107:47golanweissThanks for the quick response.
what do you mean exactly?
Can you give me an example of what to put in the deps.edn?
There’s only :paths and adding “test” there doesn’t help.#2021-04-2107:47golanweissI think the correct behavior should be to keep user decisions of the IDE and not override them.#2021-04-2107:48golanweiss> If you’re using a build integration to manage your module
I did not understand what do you mean exactly.
This is just a clojure deps monorepo project in IntelliJ.#2021-04-2122:44cflemingWhen you use a build system like Lein, Deps or something like Maven, then the details of the corresponding IntelliJ module are updated to match the details from the build file. So if you want the details reflected into IntelliJ to change, you need to update your build file rather than updating the configuration in the IDE. This means that things you want marked as source roots need to be either under :paths or under :<alias>/:extra-paths.#2021-04-2109:25Ronny LøvtangenMy src/clj folder ends up being marked as test source, not source.
I have src/cljc in :paths and adds src/cljs and src/clj through :extra-paths in different aliases.
{
:paths ["src/cljc"]
...
:aliases {
...
:server {:extra-paths ["src/clj"]
...
:test {:extra-paths ["test" "src/clj"]
Is it last alias that wins?
How does Cursive figure out that a path should be test source, does it look at the alias name?#2021-04-2110:20Janne SauvalaThese are configured by IntelliJ, so if you click that folder, open the menu, select “Mark Directory as…” and then change the type which one you want it to be#2021-04-2110:21Janne SauvalaI think Cursive doesn’t affect to how these directories are marked in IntelliJ 🙂#2021-04-2110:51imreCursive does mark them#2021-04-2110:51imreBring up your "clojure deps" tool window#2021-04-2110:52imreunder aliases, select the ones you need for development#2021-04-2110:52imrein my experience that affects what cursive will see as dev/test roots#2021-04-2110:53imrewrt how cursive decides whether something should be a dev or a test root, I don't know#2021-04-2110:55imreI guess one could circumvent this by not having the same path in more than 2 aliases and then combining those aliases when running the tests#2021-04-2110:55imrebut that might not work in your case#2021-04-2111:50Ronny Løvtangen@UJZ6S8YR2 I can use “Mark Directory as…” to change the type. But Cursive will change it back after a while.#2021-04-2111:54Ronny Løvtangen@U08BJGV6E I have both aliases checked in “clojure deps” tool window.
I can try to move alias ‘server’ after ‘test’ to see if it’s an order issue.#2021-04-2111:55imreThose are inside an unordered map so I doubt that would help. I'd imagine Cursive has some logic along the lines of "if the path appears in an alias that looks test-y then it will be marked a test path"#2021-04-2111:55imreBut if it does help, all the better#2021-04-2111:55Janne SauvalaOh okay, good to know that Cursive controls also that :thumbsup::skin-tone-2:#2021-04-2111:58Ronny LøvtangenCombining aliases is an option, but then we need to change our build script that expect all projects being able to run tests with clj -A:test#2021-04-2111:59imreyeah, that's what I had in mind#2021-04-2112:00imre@U0567Q30W should be able to shed some light on the underlying logic. I don't see anything flawed with your project config so it would be ideal if the ide could accommodate it#2021-04-2112:23golanweissActually I started asking exactly about this issue https://clojurians.slack.com/archives/C0744GXCJ/p1618987662223900#2021-04-2112:35Ronny LøvtangenYes, but I want Cursive to take control, similar to how IntelliJ works with other types of projects. Just need to configure my project such that Cursive does the right thing#2021-04-2122:49cflemingThe problem with this is that deps doesn’t provide a way to specify that something is a test path. Here’s what Cursive does currently:
1. Anything from :aliases/:test/:extra-paths is marked as a test root.
2. If you have other source roots (either from :paths or some :extra-paths), if you have manually marked those as a test root then Cursive will continue to respect that.#2021-04-2122:50cflemingThe use case which is not handled by this is if you have a root in :aliases/:test/:extra-paths which you have manually marked as a normal source root - I think this is Ronny’s case. I’d have to go through the logic with a fine tooth comb, but I don’t think there’s a good way to allow a path under the :test alias to be a normal source root.#2021-04-2122:57cflemingOne way to think about this is: when Cursive syncs the project to the module, it has to decide how to mark each root. Imagine that your server alias instead looked like: :server {:extra-paths ["server-sources" "src/clj"] .... Presumably in the IDE you would select both the server and test aliases (like this: https://cursive-ide.com/userguide/deps.html#working-with-aliases) because you’d want all of the folders “server-sources”, “src/clj” and “test” from the two aliases to be marked as roots. In that case, how should Cursive mark the “src/clj” folder? It’s inherently ambiguous.#2021-04-2205:30imreOne way perhaps could be that paths that are in aliases/test/extra-paths and also under aliases/somethingelse/extra-paths could be handled per point 2.
Approaching another way: only paths that only appear in the test alias would be automarked as test source roots#2021-04-2205:31imreOf course this could break another edge case#2021-04-2206:29Ronny LøvtangenMakes sense to only mark paths that are exclusively in :test alias as test source. Test classpath needs, by nature, to include source under test, and tools-deps doesn’t provide a way to inherit paths from other aliases, only from the top level :paths. If I include src/clj in the top level :paths it will also be part of the ClojureScript part of our build, which I am trying to avoid.
Of course there is the possibility to invoke test with more aliases to combine the needed classpath, something like clj -A:clj-src:test , but there is something nice about expecting all projects to run tests with the simple clj -A:test#2021-04-2207:46golanweiss@U0567Q30W
> 2. If you have other source roots (either from `:paths` or some `:extra-paths`), if you have manually marked those as a test root then Cursive will continue to respect that.
This is great, indeed works!
Can it be done also for “Resources root”? Right now if I put the “resources” folder under :path it override-marks it with “Source root”, and if I put in :extra-paths it just clears my marking.#2021-04-2209:35cflemingYeah, I’m not sure about making that change, since it’s very hard to predict what it might break. I guess the effect would be limited to the IDE (i.e. it won’t break anything for deps itself), and the workaround would just be to manually mark those cases as tests.#2021-04-2209:37cfleming> Can it be done also for “Resources root”? Right now if I put the “resources” folder under :path it override-marks it with “Source root”, and if I put in :extra-paths it just clears my marking.
In :extra-paths it will also mark as a source root if the alias is selected to be synced as described in the doc link above. Cursive doesn’t support resource paths for deps, because deps itself doesn’t support them - it only has the concept of “things which are on the classpath”. I wouldn’t even worry about the test marking (since deps doesn’t support that concept either), except that some things in IntelliJ rely on it.#2021-04-2109:49octahedrionis there a way to add middleware to Cursive's nREPL server ?#2021-04-2110:57flowthingCursive respects .nrepl.edn: https://nrepl.org/nrepl/usage/server.html#server-configuration#2021-04-2119:21dangercoderHas anyone tried to use https://github.com/kkinnear/zprint or cljfmt with Cursive?
The way we keep our code style consistent right now with Cursive is pull-requests and a “code formatting standard” which follows the community style guidelines.
I would much like to use a formatting tool instead, I did see someone who had a intellij clojure codestyle that resembles cljfmt: https://gist.github.com/d-t-w/a239dfca4f57b7ff6f38c895b7f45405.#2021-04-2210:46borkdudeAre there any clj-kondo users that can help @jtlocsei?#2021-04-2213:18Kari Marttila@jtlocsei I use clj-kondo with Cursive (using LSP) and it should just work. Do you see the little green ball in bottom right info area saying that connection to LSP server is established?
Are you sure the path to your clj-kondo standalone jar is correct? Are you sure you are using stanalone version?
I could have a screen sharing session with you but unfortunately I was suddenly hospitalized last weekend and now mostly laying in bed without my gallbladder and a huge incision carve in my belly and cannot sit. 😀#2021-04-2213:20Kari MarttilaAh... I missed that he already got it working with LSP.#2021-04-2222:32tobias@U76D9RZRR I appreciate your offer of help! I got it working before I saw your comment but your comment was still useful because I hadn't noticed the green ball with the connection info. Occasionally the LSP fails to load so it's handy to be able to restart it from the green ball. Good luck with the recovery from your surgery! It sounds like a big surgery.#2021-04-2307:16Kari MarttilaHeh, I am happy I was able to help anyway. 😀#2021-04-2307:33borkdude@U76D9RZRR Take care!#2021-04-2307:42Kari MarttilaI will! Thanks!#2021-04-2211:15borkdudeHe just let me know that it works using the LSP plugin#2021-04-2309:00cyppanAm I the only one having strange Cursive behavior since the last 16/04 update..? I have files that don’t recognize any var and Clojure core functions randomly, protocol implementations not recognized either. I have to remove the :require part from the namespace and then re-adding them progressively to make it work again. I’ve also tried removing the .idea folder and reimporting the project without success...#2021-04-2309:39cflemingThat sometimes happens after updates, generally File -> Invalidate indexes and restart… will fix that.#2021-04-2309:43cyppanthank you good to know, I’ve reinstalled cursive and it works now but I’ll try that next time 👍#2021-04-2309:44cflemingMore suggestions here too: https://cursive-ide.com/userguide/eap/troubleshooting.html#help-lots-of-symbols-don-t-resolve#2021-04-2405:34kennytiltonDoes that ^^^ need sth for shadow-cljs.edn? I just finally got Cursive going for that using https://ghufran.posthaven.com/setting-up-a-reagent-clojurescript-project-with-shadow-cljs-and-cursive#2021-04-2714:38katoxIt seems to be related to the "idempotent computation" dialog. It could be that only one of resulting values is saved and that could lead to corrupted indexes. It used to be quite rare but with recent IDEA versions and Cursive I need to "restart and invalidate" on daily basis. If you re-run indexing you're more likely to avoid this race condition (speculating).#2021-04-2501:11alex-ebertshi @cfleming, In code that has lots of ‘:keywords’, I often hit the semi-colon which jumps me to the default line comment position (which is fine). Unfortunately, hitting undo often returns me to several characters before the mistake occurred which can be annoying. I noticed that a previous issue had been closed on github: https://github.com/cursive-ide/cursive/issues/583. Should this issue be fixed? I’m using paredit on IJ #IC-203.7148.57, with cursive version 1.9.4. Thanks!#2021-04-2708:27cflemingYes, I think this should have been fixed. I’ll check to see if I can figure out why it’s regressed.#2021-04-2819:28alex-eberts@cfleming Thanks! Please let me know if I can help with any debugging.#2021-04-2506:08roklenarcichas anyone had a problem with the recent version, where the Leiningen tab stopped working… in that it shows no project and no dependencies?#2021-04-2622:36cflemingDo you see that in all projects, or just a specific one? Does re-adding your project (right click in project view, select “Add as lein project”) work?#2021-04-2708:49roklenarcicI had to invalidate cache#2021-04-2512:11seriogaYes, it is very annoying
https://clojurians.slack.com/archives/C0744GXCJ/p1619313091251300#2021-04-2600:04kennyIn Cursive 1.10.2-2021.1, it seems IntelliJ's intelligent spell checker no longer works. Screenshot 1 is Cursive 1.10.2-2021.1. "togehter" used to be underlined in green with the inspection saying "Type: In word 'togehter'".#2021-04-2600:08kennyWorking example from 1.10.1-eap3-2020.3.#2021-04-2600:10kennyUpdating to Cursive 1.10.2-2020.3, breaks the spell check.#2021-04-2600:14kennyfyi, https://github.com/cursive-ide/cursive/issues/2538#2021-04-2708:30cflemingThanks for the issue, I’ll take a look.#2021-04-2622:03Jeff EvansIs it just me, or is debugging extremely difficult? Line based breakpoints are close to useless (even if you set -Dclojure.compiler.disable-locals-clearing=true). Because of the way the Clojure compiler works, I suppose, the context in which you hit each line varies drastically. Sometimes, symbols are in scope at that particular “hit” and other times, not. So that makes it difficult to even set conditions on your breakpoints (because very often the symbol you want to write some condition on isn’t available, yielding an error).
I don’t think this is necessary a Cursive issue, but since I’m using IntelliJ/Cursive with OpenJDK debugger (as I suspect many are), it seems like the closest channel. Anyone have similar experience? How are you managing it?#2021-04-2708:31cflemingIt’s occasionally a little flakey, but it’s not usually that problematic. I’d be interested in seeing a screenshot of the debugger in a case where you’re not seeing locals you think you should be.#2021-04-3003:39kennytiltonIt is "just you", in the sense that you choose to do interactive debugging. Just pour in the print statements, sit back and see the bug appear: https://tilton.medium.com/the-mind-is-a-terrible-thing-cc2ca0293095#2021-04-3007:42cflemingI’d respectfully disagree with that, I do use print debugging sometimes, but I also spend significant time in the debugger too - both are useful. The debugger is also significantly more useful in languages like Java, it’s unusually finicky in Clojure (for various reasons, including the relative immaturity of Cursive).#2021-04-3014:59Jeff Evansyeah, an interactive debugger can be indispensable in certain cases. other times, adding some print statements helps fix the issue. and of course, we have the REPL which is extremely powerful.
a technique I just “rediscovered” (since I figured it out like a year ago, then forgot) is to call (def crazy-value …) from the debugger evaluator window, which will put that thing into your local namespace to play around with at your leisure.#2021-04-3021:36Jeff Evanssadly, what I’m finding lately is that attaching the debugger and setting a few line breakpoints (even unconditional) slows down the program execution by 100x or 1000x, and if that happens, it’s unusable#2021-04-2623:06Alex Miller (Clojure team)in general, you'll get a "step" for each expression - sometimes it helps to keep that in mind if you're walking through (or even to break up the code into more lines temporarily to make it clearer#2021-04-2623:07Alex Miller (Clojure team)generally I only use the debugger when I'm interacting closely with an inscrutable Java API so I can walk across the interface#2021-04-2623:07Alex Miller (Clojure team)usually for Clojure code it's easier to just interactively evaluate code from the source#2021-04-2701:13Jeff EvansYeah using the REPL more is clearly superior. But sometimes you're in 20 calls deep, with some data from the DB in scope, and just want to see what keys are there (or whatever).
I think breaking up stuff more is probably a good approach. Especially in the middle of a let#2021-04-2702:44phronmophobicSome posted this the other day. Maybe it’s a good fit https://github.com/gfredericks/debug-repl#2021-04-2708:16Ronny LøvtangenFor that use case, I prefer using https://github.com/vvvvalvalval/scope-capture
Rather than stopping at a break point, you “record” all variables in scope and can use REPL to inspect those variables afterwards.#2021-04-2715:09TrevorI'm sure this has been asked before, but I'm curious what would be the best thing to do to get intellisense for typescript libs?
Compilation is much more straightforward now with shadow-cljs, but would be cool if I could get the ability to leverage cursive's ability to auto-import typescript libraries like I can import clojure(script) libraries.
My first thought is that I take a stab at generating a bunch of clojurescript namespaces with wrapper methods and defs using the typescript compiler to give me an AST from .d.ts files (or even just ts files). But with cursive is there something even better I could generate? Something that would expose the actual typescript lib's API instead of my wrapper code?
(Definitely a lot of work I'm sure, but sounds like a fun side-project)#2021-04-2720:09cflemingThat’s basically what I’m planning to do (have support based on .d.ts files), but I’ll write a parser for them in Java or Kotlin since the format is not as complex as full typescript.#2021-04-2802:56TrevorUnsure if this is helpful (typescript -> Kotlin) .
https://github.com/Kotlin/dukat
Anything I can do to help? Would be so neat to have bindings for Phaser :) #2021-04-2909:46cflemingI’m not sure about that, I’ll take a look, thanks!#2021-04-2821:28alex-ebertsDoes anyone know if dependency autocompletion is supported for deps.edn projects as described in this blog post? https://www.deps.co/blog/whats-new-in-cursive-1.5.0/#2021-04-2821:29alex-ebertsI’ve verified that I have maven repos in my preferences. When I use the “Generate” command the “Artifact Search” dialog is stuck on “Loading…”#2021-04-2821:31alex-eberts#2021-04-2821:59danielcomptonHey, I can take a look at generating these files, it’s not currently supported#2021-04-2821:59danielcomptonI need to do maven indexing#2021-04-2822:07alex-eberts@U051KLSJF Many thanks! Let me know if I can help at all…#2021-04-2901:25cfleming@U0G3C3USJ Just to check, are you using http://Deps.co as your repository, or is this just a standard deps.edn project?#2021-04-2901:29alex-ebertsI’m not using http://deps.co. It’s a standard deps.edn project. #2021-04-2901:30cflemingOk, sadly that means I can’t foist this off on @U051KLSJF 🙂.#2021-04-2901:31cflemingWhich version of Cursive are you using? Do you have custom repos in your deps file?#2021-04-2904:52alex-ebertshi @U0567Q30W I’m running Cursive 1.9.4-2020.3 at the moment but there’s nothing blocking me from upgrading to the newest version of Cursive if necessary.#2021-04-2912:25octahedrionhas anyone got breakpoints working with the latest Cursive ?#2021-04-2914:51Jeff Evansworking for me on IJ Ultimate 2020.3, Cursive 1.10.2-2020.3#2021-04-2915:43octahedrionI'm on the same versions except IJ CE#2021-04-2915:53octahedrionok I've got it. Breakpoints don't work in a namespace if you eval code in that ns using "send form to REPL"#2021-04-2915:55octahedrionyou have to eval code from another namespace because otherwise it can't find the information needed and the breakpoint turns into a grayed-out icon#2021-04-2915:57octahedrionso it looks like breakpoints are limited to code outside the namespace from which you're evaluating code#2021-04-2920:28cflemingNo, that’s not right - the main problem is generally line numbers in the generated code, which can change if you’re editing and sending only parts of a namespace (i.e. with send form).#2021-04-2920:29cflemingIf you’re debugging a namespace, I always recommend re-sending the whole file to ensure all the line numbers are correct.#2021-04-3007:55octahedrionI tried that (select-all, send to REPL) many times in different ways and it didn't work for me. Then I tried doing (use :reload this-namespace) in my (comment) block in the same file and it worked!#2021-04-3010:52cflemingSelect all and send is not the same thing, you want to use Tools -> REPL -> Load file in REPL which uses load-file and correctly creates the line numbers in the bytecode. Or require :reload will work too, anything that causes the whole namespace to be loaded using load-file.#2021-04-3011:00octahedriongot it. It works#2021-04-3011:08octahedrionthanks for your help!#2021-04-3017:47jacekschaeWhat is the way to move a package and rename ns correctly? I felt like this was working yet now I can’t get it to work? Any ideas?#2021-04-3021:33cflemingIntelliJ 2021.1.1 is out. As described in this blog post, it had a bunch of index corruption bugs which have possibly provoked the problems that some users have been having. @katox I’d be interested to know if this fixes the need to invalidate constantly that you were having. https://blog.jetbrains.com/idea/2021/04/intellij-idea-2021-1-1/#2021-05-0107:52katoxOh, thanks for pointing that out. Hopefully it'll go away. I'll update and keep an eye on it for a while.#2021-05-0305:40gklijsI think I had some. At least cursive was giving errors, even for non Clojure projects.#2021-05-0317:56katoxSomething is still not quite right. For instance I deleted a file (+ committed the change into git) and after about an hour the indexer wanted to access it anyway:
java.lang.Throwable: Invalid file: file:///home/katox/...rules.clj (invalid)
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:161)
at com.intellij.psi.impl.file.impl.FileManagerImpl.findFile(FileManagerImpl.java:351)
at cursive.psi.impl.synthetic.ClNamespace.lambda$getContainingFile$0(ClNamespace.java:95)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:830)
at cursive.psi.impl.synthetic.ClNamespace.getContainingFile(ClNamespace.java:95)
at org.jetbrains.idea.maven.dom.MavenDomUtil.isMavenFile(MavenDomUtil.java:110)
at org.jetbrains.idea.maven.dom.MavenModelDocumentationProvider.getMavenElement(MavenModelDocumentationProvider.java:106)
at org.jetbrains.idea.maven.dom.MavenModelDocumentationProvider.getMavenElementDescription(MavenModelDocumentationProvider.java:61)
at org.jetbrains.idea.maven.dom.MavenModelDocumentationProvider.getElementDescription(MavenModelDocumentationProvider.java:55)
at com.intellij.psi.ElementDescriptionUtil.getElementDescription(ElementDescriptionUtil.java:17)
at com.intellij.usageView.UsageViewUtil.getType(UsageViewUtil.java:59)
at com.intellij.find.findUsages.PsiElement2UsageTargetAdapter.getLongDescriptiveName(PsiElement2UsageTargetAdapter.java:244)
at com.intellij.find.impl.ShowRecentFindUsagesGroup.getChildren(ShowRecentFindUsagesGroup.java:43)
at com.intellij.ide.util.gotoByName.GotoActionModel.lambda$collectActions$1(GotoActionModel.java:388)
at com.intellij.util.SlowOperations.allowSlowOperations(SlowOperations.java:64)
at com.intellij.ide.util.gotoByName.GotoActionModel.collectActions(GotoActionModel.java:388)
at com.intellij.ide.util.gotoByName.GotoActionModel.collectActions(GotoActionModel.java:400)
at com.intellij.ide.util.gotoByName.GotoActionModel.collectActions(GotoActionModel.java:400)
at com.intellij.ide.util.gotoByName.GotoActionModel.collectActions(GotoActionModel.java:400)
at com.intellij.ide.util.gotoByName.GotoActionModel.buildActions(GotoActionModel.java:114)
at com.intellij.ide.util.gotoByName.GotoActionModel.<init>(GotoActionModel.java:107)
at com.intellij.ide.util.gotoByName.GotoActionModel.<init>(GotoActionModel.java:99)
at com.intellij.ide.actions.searcheverywhere.ActionSearchEverywhereContributor.<init>(ActionSearchEverywhereContributor.java:55)
...
#2021-05-0611:11katoxOther than that I had no corrupted indexes since the bugfix update.#2021-05-0620:22cflemingGreat to hear it’s improved. That’s still an IntelliJ bug there, hopefully they’ll fix more of them in future releases.#2021-05-0620:22cflemingIf you can be bothered, it would be useful to file an issue in YouTrack about that.#2021-05-0315:21imre@cfleming does Cursive do anything funky with cljfx/javafx? I seem to have run into an issue when trying to launch Reveal from a Zulu Java 8-based Repl but only when that's launched from Cursive. I created a hopefully minimal repro case at https://github.com/imrekoszo/reveal-zulu#2021-05-0316:37imreA workaround is to launch the repl from the command line and connect to it from Cursive (nrepl in my case)#2021-05-1313:23imreEnded up recording this as https://github.com/cursive-ide/cursive/issues/2549 as it's still present in 2021.1#2021-05-1322:58cflemingThanks, I’ll take a look. I assume this is on an M1 mac?#2021-05-1406:52imreNo, intel#2021-05-1406:52imreAnd thank you#2021-05-1407:04cflemingInteresting, why the Zulu in that case?#2021-05-1407:29imreI found that it wasn't working with oracle 8 so I tried zulu. Same symptoms, but zulu can be easier installed on the command line#2021-05-1407:29imreSo I ended up putting that into the repro#2021-05-1407:30imreStrange that the error only happens when the repl is launched from within cursive, not when I attach to the process launched from the cmdline#2021-05-1408:00cflemingThat is very weird.#2021-05-1408:22imreLet me know if anything is unclear about the problem description and I'll try to clarify it#2021-05-1812:26imreI dug into this a bit and found that when starting the repl from cursive, /Users/ikoszo/.m2/repository/cljfx/cljfx/1.7.12/cljfx-1.7.12-jdk11.jar is passed to java as part of the classpath#2021-05-1812:27imreWhile if I do a -Spath in the project, I get /Users/ikoszo/.m2/repository/cljfx/cljfx/1.7.12/cljfx-1.7.12-jdk8.jar in its place#2021-05-1812:27imrenote jdk8 vs jdk11#2021-05-1812:28imreThe Cursive behaviour seems to be the same regardless of whether I run the repl with 'use deps' or 'use intellij project classpath'#2021-05-1812:29imreAnother difference is that all the jdk jars are explicitly passed in the classpath when running from Cursive:
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/charsets.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/crs-agent.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/ext/cldrdata.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/ext/dnsns.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/ext/jaccess.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/ext/jfxrt.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/ext/legacy8ujsse.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/ext/localedata.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/ext/nashorn.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/ext/openjsse.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/ext/sunec.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/ext/zipfs.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/jce.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/jfr.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/jfxswt.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/jsse.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/management-agent.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/resources.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/jre/lib/rt.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/lib/ant-javafx.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/lib/dt.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/lib/javafx-mx.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/lib/jconsole.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/lib/packager.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/lib/sa-jdi.jar
/Users/ikoszo/.sdkman/candidates/java/8.0.282.fx-zulu/zulu-8.jdk/Contents/Home/lib/tools.jar
#2021-05-1812:34imreThe former difference is sus#2021-05-1812:34imreI added this info to the ticket#2021-05-0315:50Jeff Evansis it actually useful to submit the stack traces from the UI when a Cursive error occurs?#2021-05-0316:59imreI sure hope so cause I use it often 🙂#2021-05-0317:16Jeff Evanssame. but if it ends up being pure noise, then I’d stop#2021-05-0320:33cflemingIt’s definitely useful. I don’t always look at each one individually, but the repo aggregates them so I get an idea of which errors happen in which versions, and how frequently.#2021-05-0323:13hlshipIs there a way to debug namespace reloading? I have ns T that depends on ns A and ns B; B also depends on A. However, when I change A I only see T reloading (as in, I added println’s to ns B so I could see when it reloaded). T is a test, B is test utilities, A is production code.#2021-05-0411:02cflemingAre they all in the same module?#2021-05-0411:02cflemingAre you using deps or lein?#2021-05-3104:59cflemingEAP supporting this is out now.#2021-05-3104:59cfleminghttps://twitter.com/CursiveIDE/status/1399228633550516229#2021-06-0103:40onetomunfortunately, im only getting an empty window when IntelliJ 2021.2 EAP is trying to load my previously open project.
it starts showing a progress bar to load the project, but that popup just disappears and leaves a completely empty window behind, with not toolbar or tool-window controls or status bar.
if i open an other recent project (the clojurescript source code for example) i just get a new empty window too.
i tried invalidating the caches, but it did not change anything, i still behaved the same after restart#2021-06-0104:00onetomi suspect, it's related to the fact that i had to reinstall my nix after upgrading to the latest macOS update, so neither the clojure cli path, nor the java sdk paths are valid anymore.#2021-06-0104:22onetomi've updated the path to Clojure CLI, but that wasn't sufficient.#2021-06-0104:30cflemingIf you create a new project, does that create successfully?#2021-06-0104:51onetomnope.
i've done the following:
cd /tmp
git clone ~/some/project
rm -rf project/.idea
rm $(fd .iml project/)
idea-eap /tmp/project
and i've just ended up with an empty window#2021-06-0104:53onetomi got these files created in /tmp/project/.idea/:
-rw-r--r-- 1 onetom wheel 176B Jun 1 12:49 ClojureProjectResolveSettings.xml
-rw-r--r-- 1 onetom wheel 622B Jun 1 12:49 misc.xml
-rw-r--r-- 1 onetom wheel 879B Jun 1 12:49 workspace.xml
where the ClojureProjectResolveSettings.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ClojureProjectResolveSettings">
<currentScheme>IDE</currentScheme>
</component>
</project>#2021-06-0105:10onetomi've tried something even simpler:
$ mkdir deps-skeleton
$ cd deps-skeleton
$ echo '{}' > deps.edn
$ idea-eap .
and I got a dialog, titled Error Loading Default Project, with a content saying java.lang.StackOverflowError and an OK button.#2021-06-0105:11onetomand this dialog appeared right on top of the splash screen#2021-06-0105:12onetomthis sounds like something which should be reproducible#2021-06-0105:13onetomI'm on macOS 11.4 (20F71) and the latest 2021.2 EAP IntelliJ Ultimate, I could download through the JetBrains Toolbox#2021-06-0105:13onetomand Cursive 1.10.3-eap1-2021.21#2021-06-0105:17cflemingCan you email me your log file?#2021-06-0105:17cfleming<mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection>#2021-06-0105:18cflemingHelp->Show log in Finder#2021-06-0106:57cflemingThis is the SOE:
2021-06-01 13:09:21,558 [ 52221] ERROR - llij.ide.plugins.PluginManager - java.util.concurrent.ExecutionException: java.lang.StackOverflowError
java.util.concurrent.CompletionException: java.util.concurrent.ExecutionException: java.lang.StackOverflowError
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
at java.base/java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:787)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1742)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1728)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool.awaitQuiescence(ForkJoinPool.java:2984)
at com.intellij.idea.StartupUtil.start(StartupUtil.java:286)
at com.intellij.idea.Main.bootstrap(Main.java:117)
at com.intellij.idea.Main.main(Main.java:83)
Caused by: java.util.concurrent.ExecutionException: java.lang.StackOverflowError
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2022)
at com.intellij.openapi.project.impl.ProjectManagerExImpl.openProject(ProjectManagerExImpl.kt:73)
at com.intellij.platform.PlatformProjectOpenProcessor$Companion.doOpenProject(PlatformProjectOpenProcessor.kt:128)
at com.intellij.platform.PlatformProjectOpenProcessor.openProjectAndFile(PlatformProjectOpenProcessor.kt:251)
at com.intellij.ide.CommandLineProcessor.doOpenFile(CommandLineProcessor.java:90)
at com.intellij.ide.CommandLineProcessor.doOpenFileOrProject(CommandLineProcessor.java:61)
at com.intellij.ide.CommandLineProcessor.lambda$openFileOrProject$5(CommandLineProcessor.java:313)
at com.intellij.ide.lightEdit.LightEditUtil.computeWithCommandLineOptions(LightEditUtil.java:241)
at com.intellij.ide.CommandLineProcessor.openFileOrProject(CommandLineProcessor.java:309)
at com.intellij.ide.CommandLineProcessor.processOpenFile(CommandLineProcessor.java:258)
at com.intellij.ide.CommandLineProcessor.processExternalCommandLine(CommandLineProcessor.java:158)
at com.intellij.idea.IdeStarterKt.loadProjectFromExternalCommandLine(IdeStarter.kt:207)
at com.intellij.idea.IdeStarterKt.access$loadProjectFromExternalCommandLine(IdeStarter.kt:1)
at com.intellij.idea.IdeStarter.openProjectIfNeeded(IdeStarter.kt:145)
at com.intellij.idea.IdeStarter.main(IdeStarter.kt:79)
at com.intellij.idea.ApplicationLoader$startApp$3.run(ApplicationLoader.kt:185)
at java.base/java.util.concurrent.CompletableFuture$UniRun.tryFire(CompletableFuture.java:783)
... 8 more
Caused by: java.lang.StackOverflowError
at java.base/java.lang.String.indexOf(String.java:1691)
at kotlin.text.StringsKt__StringsKt.indexOf(Strings.kt:1099)
at kotlin.text.StringsKt__StringsJVMKt.replace(StringsJVM.kt:81)
at kotlin.text.StringsKt__StringsJVMKt.replace$default(StringsJVM.kt:79)
at com.intellij.ide.plugins.IdeaPluginDescriptorImplKt.pluginPathToUserString(IdeaPluginDescriptorImpl.kt:491)
at com.intellij.ide.plugins.IdeaPluginDescriptorImpl.toString(IdeaPluginDescriptorImpl.kt:485)
at java.base/java.lang.String.valueOf(String.java:2951)
at java.base/java.lang.StringBuilder.append(StringBuilder.java:168)
at com.intellij.ide.plugins.cl.PluginClassLoader.toString(PluginClassLoader.java:487)
at java.base/java.lang.String.valueOf(String.java:2951)
at java.base/java.lang.StringBuilder.append(StringBuilder.java:168)
at com.intellij.serviceContainer.ComponentManagerImplKt.doLoadClass(ComponentManagerImpl.kt:1452)
at com.intellij.serviceContainer.ComponentManagerImplKt.access$doLoadClass(ComponentManagerImpl.kt:1)
at com.intellij.serviceContainer.ComponentManagerImpl.loadClass(ComponentManagerImpl.kt:804)
at com.intellij.serviceContainer.BaseComponentAdapter.getImplementationClass(BaseComponentAdapter.kt:38)
at com.intellij.serviceContainer.BaseComponentAdapter.getComponentImplementation(BaseComponentAdapter.kt:31)
at com.intellij.serviceContainer.MyComponentAdapter.toString(MyComponentAdapter.kt:65)
at com.intellij.serviceContainer.BaseComponentAdapter.getImplementationClass(BaseComponentAdapter.kt:41)
at com.intellij.serviceContainer.BaseComponentAdapter.getComponentImplementation(BaseComponentAdapter.kt:31)
at com.intellij.serviceContainer.MyComponentAdapter.toString(MyComponentAdapter.kt:65)
#2021-06-0106:58cflemingThat doesn’t seem to be Cursive related at all, as far as I can tell.#2021-06-0106:59cflemingIt looks like something is funny with your IntelliJ install, but I’m not sure what that might be.#2021-06-0111:40onetomthank you for having a look!
next time i will be able to debug 1 step further.
indeed, on another machine, the configuration of the same jetbrains user and the same code repo, on the same code branch, does not exhibit the same behaviour.
i did notice that despite having the configuration synced via a jetbrains account, i still have different sets of plugins on different machines, so the issue mostly likely stems from such difference, cause by some rogue plugin...#2021-05-3117:00wilkerluciohello, not a specific Cursive issue, but maybe somebody here knows it. My intellij stopped being able to find executables in my machine, things like bb and clj-kondo, I have File Watcher that uses clj-kondo, but since I upgrade IntelliJ it stopped working, IntelliJ says the executable is not available, but in a normal terminal it works fine, any ideas how to fix it?#2021-05-3121:52cflemingYeah, deps now shells out to git and that actually worked which surprised me. The CWD of IntelliJ is inside the app somewhere, and env vars from your shell environment don’t usually get propagated to it correctly. I’m not sure why this would have broken though, can you use a full path to the executable?#2021-06-0115:24wilkerlucioin some cases I can, but not all#2021-06-0115:24wilkerlucioI think somebody else open a issue about this: https://youtrack.jetbrains.com/issue/IDEA-269715#2021-06-0115:29wilkerluciofor anyone having this issue, seems like it fixes itself if I start IntelliJ from the terminal, instead of clicking on the dock icon#2021-06-0120:07raspasovI think this happened to me as well for clj-kondo. What I think fixed it was using a full path to clj-kondo#2021-06-0120:08raspasovFull path under “Program:”#2021-06-0120:32wilkerluciofull path solved this problem to me, but them I had issues with my git hooks#2021-06-0120:32wilkerlucioand those I cant use full path because come from team shared files#2021-06-0120:33wilkerluciostarting from terminal made all work fine#2021-06-0115:24wilkerlucioI think somebody else open a issue about this: https://youtrack.jetbrains.com/issue/IDEA-269715#2021-06-0102:33zebuWith my leiningen project, when I start the repl, it won’t accept any commands typed into it and there is a message saying “this view is read only”. Also I can’t find any commands in the ide to send forms to the repl#2021-06-0102:41zebuthis is on windows, cursive 1.10.2-2021.1, java 1.8, intellij 2021.1.1 community edition, build 211.7142.45 (april 30). project opened using the open project, and pointing to the project.clj file#2021-06-0104:31cflemingCan you send a screenshot of your REPL toolwindow? It sounds like your REPL is not starting correctly.#2021-06-0104:35zebu#2021-06-0104:54zebu#2021-06-0105:17cflemingYou can’t use the lein run config like that, you’ll need to use the REPL run config type as described here: https://cursive-ide.com/userguide/repl.html#2021-06-0105:59zebuThat worked, thanks Colin#2021-06-0105:03onetomI'm trying to version control the Clojure Code Styles settings for a project, because we had to set the formatting of defmulti to Indent manually, but I have no idea where does that configuration go to.
I've changed the Editor / Code Style / Clojure / Scheme: to Project, then Opt-Enter Configure indentation for clojure.core/defmulti and set it to Indent and grep -r defmulti .idea doesn't yield anything, although .idea/codeStyles/codeStyleConfig.xml does reflect my choice of "formatting scheme":
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>#2021-06-0105:07onetomThere is a little cog next to the Code Style / Scheme drop-down, which lets me export the config into a code style XML or an EditorConfig file, but it offers to save it to ~/Project.xml by default, which sounds odd.
I wouldn't think that I should do such manual export for being able to version control these settings, but then where is this config stored?#2021-06-0120:12borkdude@wilkerlucio if the filewatcher doesn't work out, you can also try the lsp approach for clj-kondo#2021-06-0321:06wilkerluciocool, I didn't tried it yet, maybe its time#2021-06-0321:16borkdudeI mean this one:
https://github.com/clj-kondo/clj-kondo/blob/master/doc/editor-integration.md#lsp-server-1#2021-06-0321:16borkdudebut of course you could also give clojure #lsp a chance#2021-06-0321:16wilkerlucioyes, I just finished the setting up, looks cool, gonna see if I notice any differences from the file watcher setup#2021-06-0401:51wilkerluciowhen editing large files I notice a significant performance hit when the LSP is active#2021-06-0401:52wilkerlucioI guess its verifying things as I type, while the file watcher only does it when I save#2021-06-0217:53Rob HaisfieldCan I run a Reveal REPL in Cursive? https://vlaaad.github.io/reveal/
Edit: I actually found this but still curious to see opinions about the experience. https://vlaaad.github.io/reveal/#cursive#2021-06-0218:00Rob HaisfieldActually, for some reason, the option to Run with Deps is grayed out for me so I can’t follow the instructions#2021-06-0218:49R.A. PorterDo you have a deps.edn configured? That looks like you have a leiningen-based project (`project.clj`).#2021-06-0306:08onetom@rob370 i did setup reveal in a project which im using from cursive, but hasn't actually utilized the reveal window a lot, because the extra mental overhead of switching to the reveal window, instead of just looking at the built-in cursive window, somehow is too much.
otherwise, reveal seems to work just fine...
don't forget to create a .nrepl.edn next to your deps.edn, containing something like {:middleware [vlaaad.reveal.nrepl/middleware]}.
then if you are annoyed by the opening reveal window, u can just turn it off by #_ commenting the vlaaad part.#2021-06-0310:00ikitommiis there a way to define a new qualified keyword source (e.g. like s/def is?)#2021-06-0312:46Kari MarttilaIs it safe to migrate to the newest IDEA 2021.1.2 (i.e. no issues with Cursive)?#2021-06-0312:53mike_ananevI'm using IDEA 2021.1.2. No errors found, yet.#2021-06-0312:57Kari MarttilaOk. Thanks!#2021-06-0319:02tamasjungCould anybody confirm if macro expansion is working/broken with recent versions? (tried several combinations, currently Cursive: 1.10.3-eap1-4-g139ba476, IJ 2021.1.2, Big Sur, for me the macro expansion window opens but throws a StrackoverflowError and none of the components, like toolbar buttons respond to mouse click)#2021-06-0319:19imreTried just now, it doesn't work.#2021-06-0319:19imreI got a NRE#2021-06-0319:20imreIt's been in limbo for quite a while now tbh#2021-06-0320:06lspectorIs there a way to start up a standalone Clojure REPL, without having an open project?#2021-06-0320:22potetmdepends on what you want. The clj command does that.#2021-06-0320:39lspectorI meant in IntelliJ/Cursive. Is there a way to do that there?#2021-06-0320:42potetmAh, I didn’t notice the room I was in. Not that I know of.#2021-06-0320:45lspectorHuh -- yes, I see I can do it in Cursive's Terminal pane (click on the terminal tab and then type clj). But I assume this is just an OS terminal so clj would have to be installed, and we'd have none of the benefits of being in Cursive.#2021-06-0320:46lspectorSo the more complete question is whether we can start a Cursive Clojure REPL in Cursive without a project.#2021-06-0403:18cflemingMore generally, there’s basically no way to do anything in IntelliJ without a project. The only thing you get without a project is the welcome splash screen.#2021-06-0403:19cflemingThe only thing that’s really possible at the moment is the new LightEdit mode (https://blog.jetbrains.com/idea/2020/04/lightedit-mode/), but as far as I know that’s pretty experimental at this stage.#2021-06-0415:49lspectorThanks @U0567Q30W. Should it be possible for me to get LightEdit mode working with a .clj file now? I tried dragging a projectless .clj file to IntelliJ in my MacOS dock, and it opened but I wasn't able to evaluate anything.#2021-06-0703:15cflemingI’m actually not sure, I haven’t tried LightEdit yet, I’m not sure if Cursive requires anything to support it. Why do you not want a project?#2021-06-0817:04lspectorI am trying to provide the simplest, most friction-free way for newcomers (often undergrad CS majors who have never seen Clojure before) to get from zero to a working REPL, so they can start to learn Clojure and gradually come to understand enough to take advantage of more of Cursive's features. I know it may be hard to grok for most people here, but the process of creating a project and starting a REPL can be pretty confusing to the newcomers, and while the docs are excellent in some respects they make lots of assumptions about background knowledge and present more information than is helpful to these new users, e.g. about different kinds of REPLs, Run Configurations, build tools, etc. The closer it can get to "install IDEA and then Cursive, and then select X to start a REPL" the better it will be. Separately, I often want a REPL for myself to do a quick calculation or play with an idea, and creating/opening dummy projects for this sort of thing is a bit of a drag. But the real thing I'm after here is onboarding new users.#2021-06-0817:07lspectorOf course there are other ways to get a quick REPL, but they mostly have annoying weaknesses (e.g. for multiline input), or they're not trivial to start up, and in any event they're not on the path that I want my students to be on, which is the path to using Cursive.#2021-06-0411:51onetomI keep experiencing a namespace loading issue, which seems to be sensitive to timing.
I change a file and if I quickly press Cmd-Shift-L or M, not all my changes are reflected in the REPL process.
It started to manifest more often lately, so I hooked up clojure.tools.namespace/refresh and kaocha to a Cursive REPL command and assigned a shortcut to it, hoping to improve the situation.
The result is total chaos.
If I use Cmd-Shift-L and refresh in alternation, my changes won't be reflected in the REPL anymore.
Has anyone using ctnr/refresh successfully from Cursive?
Has anyone experienced missed loading of changed files?
How should I approach the problem of creating a minimal reproducible example?#2021-06-0412:03onetomwe are at the point, where we have to keep restarting the REPL way too often, because we just can't trust test results anymore.
this is the REPL command definition, which I used rather successfully for months, but exhibits a timing issue:
<repl-command name="ginoco Kaocha" executionType="EXPRESSION" commandText="(time ((requiring-resolve 'kaocha.repl/run) :unit))" executeBefore="SYNC_ALL" executionNs="REPL_CURRENT" inNamespace="" saveAll="true" />
I change a character in my test code, trigger the REPL command with a shortcut, but faster than ~700ms, then the changed file is not reloaded, but the tests still run with the previous version of the code, yielding misleading test results :(
#2021-06-0412:08onetomthe new REPL command looks like this:
<repl-command name="ginoco Kaocha" executionType="EXPRESSION" commandText="(do (try (require 'gini.kaocha) (catch Exception ex)) (clojure.tools.namespace.repl/refresh) (time ((requiring-resolve 'kaocha.repl/run) :unit)))" executeBefore="SYNC_ALL" executionNs="REPL_CURRENT" inNamespace="" saveAll="true" />
they (require 'gini.kaocha) is just configuring the stack trace filters, but not available in every REPL, that's why the try-catch around it.#2021-06-0703:17cflemingI’ll try to reproduce this - Cursive does save all files before executing these commands, but it’s possible that IntelliJ takes a while to flush to disk? I’m not sure.#2021-06-0703:25cflemingIn terms of a repro test case, anything I can run would be helpful. Perhaps just a project set up like yours with a simple test (= "Hello" "Hello")? Then it should be possible to change one of the strings and run the test quickly to see the problem.#2021-06-0707:57onetomit seems the problem is that the current file is not always correctly identified as a modified file.
so if my REPL command is configured to Before executing: Sync all modified files, then i modify my test source and run my (time ((requiring-resolve 'kaocha.repl/run) :unit)) REPL command, my current test state might not be loaded into the REPL process.
the missing Loading test/ns/xxx_test.clj... done lines in the REPL tool window correctly reflect what happens.#2021-06-0707:58onetomso, this phenomena is observed without using ctnr/refresh#2021-06-0708:22onetom@U0567Q30W i've emailed you a video recording which demonstrates the issue.
i think for now i can work around the problem by just using the Before executing: Load current file and try to remember to press Cmd-Shift-M, if I modified dependent files, but haven't reloaded them manually.#2021-06-0708:28onetompushed the repo, which I used to record the video demonstration here:
https://github.com/onetom/cursive-reload-issue#2021-06-0710:50onetomI have one more suspicion; Kaocha itself, since it's not exactly a trivial piece of software.
I'm also experiencing something which makes no sense at all. I previous version of my test runs somehow, when I'm only editing and letting the Cursive REPL command load the current file and run kaocha.
after manually switching over to the test namespace an load it with Cmd-Shift-L, it finally gets updated in the REPL process.
(and I'm not changing the name of the deftest; I know that's a common cause for phantom tests; this is a different situation)#2021-06-0412:11imreI use ctnr/refresh-all but not as part of a repl command#2021-06-0412:15imrehowever, I think you need to use the :after to execute something after the refresh#2021-06-0412:15imre(repl/refresh-all :after `start)
#2021-06-0414:29bnstvnwhat does it take to have the Add dependency to project.clj command/action work? ( i believe i never saw anything in the search popup)#2021-06-0704:29cflemingYou’re right, that seems to be broken, I’ll look at that.#2021-06-0712:14bnstvnthank you#2021-06-0608:39indyCursive is amazing, thank you. I have this feature request, though not sure how feasible it is. The ability to tap a variable (using say some shortcut) and after I run the code, I should be able to see information about the tapped variable (in maybe a modal or tooltip) eg. the value itself, its type, the changed versions of the variable if any (and maybe diff the versions), be able to def the variable and so on.
I know I can use the debugger or something like https://github.com/vvvvalvalval/scope-capture or simply add-taps and tap> or just def the variable. But I thought it would be really convenient if the IDE gave me this ability out of the box. I understand the runtime of the plugin will be different from that of the code, so not sure how this might work, but maybe it could hook into the REPL for this.
I’m also aware of tools like REBL, Reveal and Portal but they require me to switch to it which I rarely do when using IntelliJ + Cursive because everything I want can be done inside the IDE. Don’t really want visualisations (or navigating a web page), just an IDE super tap would be really cool.
Would love to help in any way if this is possible.#2021-06-0619:17indyI think I can emulate something close to this with REPL commands and IntelliJ macros for now#2021-06-0703:33cflemingOne of the things I’m working on is better data structure visualisations, and that will probably be tied into tap in some way.#2021-06-0617:02pbailleHello, I would like to tweak clojure's syntax highlighting a bit, is it possible with cursive ?#2021-06-0619:16indyJump to Colors and Fonts action#2021-06-0619:17indyWhile the caret is on whatever you want to customize#2021-06-0703:34cflemingRight, if you want to customise more than what is offered there let me know.#2021-06-0706:25pbaille@UMPJRJU9E, @U0567Q30W thank you a lot, I will try this and let you know !#2021-06-0706:28pbailleOk it seems that it is the same that what I've found in the preferences. Two things that I would like to customize for example would be :
• quoted symbols
• argv bindings.
Is it possible ?#2021-06-0706:30pbailleI also noticed that clojure core symbols are highlighted even when contained in comments. I would like to fix that.#2021-06-0706:30pbailleIs there some kind of tmLanguage.json file somewhere ?#2021-06-0803:33cflemingNo, there isn’t, unless there’s an IntelliJ plugin which could colour things on top of what Cursive does.#2021-06-0709:58defaI’d like to debug a process on a remote machine using breakpoints but can not get the debugger to connect properly to the remove JVM. I have a nrepl remote REPL running successfully but connecting a debugger with IntelliJ IDEA “Remote JVM Debug” run stetting does not work. I have to tunnel the remote JVM socket using SSH port forwarding, maybe that is the problem?#2021-06-0711:38mike_ananev@defa when you start a REPL (remote process) you should put to :jvm-opts parameter
"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005"
#2021-06-0711:39mike_ananevand tell Idea to connect to debuger port 5005#2021-06-0714:17defaThanks, @mike1452, I already did that but it seems that the debugger takes a couple of minutes (!) to connect. Not sure what this is or was but not it is working. Kind of. Thanks.#2021-06-0714:17defaUnfortunately I encountered a heisenbug… now that I’m able to debug the problem, it has gone away.#2021-06-0714:48Jeff Evansyeah, it can be incredibly slow when the Java debugger gets involved, from my experience. I recommend waiting until your process is fully warmed up, before the error state (or whatever you’re trying to debug), then connect the debugger#2021-06-0714:48Jeff Evansand disconnect/reconnect it liberally#2021-06-0715:36Ian FernandezHello, my company moved to bazel builds for our Clojure/JVM-based projects. How do I configure Cursive / IntelliJ to recognize my classpath again?#2021-06-0718:33tanzoniteblackhow are you liking bazel? How is it set up to work with Clojure?#2021-06-0718:33tanzoniteblackif you don’t mind me asking#2021-06-0718:39Ian FernandezRight now the support for bazel on IntelliJ is very very bad, the company moved from deps.edn to bazel and it broke at lot of IntelliJ classpath loading stuff#2021-06-0718:39Ian Fernandez😅#2021-06-0718:39Ian Fernandezgoto var definitions are impossible for some part of the code#2021-06-0802:51cfleming@U9ABG0ERZ I know next to nothing about bazel (except that IntelliJ didn’t seem to support it well, as you’ve found). Are you able to set up a simple project that I could use to test this?#2021-06-0913:58Ian FernandezI'll try to setup a project 🙂#2021-06-0716:53thhellerthere is a bazel plugin for intellij I think#2021-06-0718:38Ian Fernandezyeah, there's a bazel plugin for IntelliJ but it does not loads the java classpath from the build#2021-06-0718:40Ian Fernandez😅#2021-06-0718:40Ian FernandezI can connect a REPL from IntelliJ but it doesn't detect modules on IntelliJ 😞#2021-06-0719:29katoxIt seems that cursive doesn't like the latest tools.deps that come with Clojure (https://clojure.org/guides/getting_started#_installation_on_linux)... `clj -Sdescribe => {:version "1.10.3.855" ...};#2021-06-0719:45imrewhat cursive version are you on? I'm on 1.10.3-eap1-2021.1 with latest clojure and it's grand#2021-06-0720:31katoxThe same EAP + 2021.1.2. I can make it work by "use deps directly" but it it worked with the older version (it broke when I updated the clj tooling)#2021-06-0802:50cflemingHmm, that’s odd, I’ll look at that.#2021-06-0803:41cflemingI can’t reproduce this. That error message is produced when this var doesn’t exist, which it does in this version (and doesn’t on very old versions of deps): https://github.com/clojure/tools.deps.alpha/blob/tools.deps.alpha-0.11.922/src/main/clojure/clojure/tools/deps/alpha/util/dir.clj#L25#2021-06-0803:42cflemingIf you look in Preferences | Build, Execution, Deployment | Build Tools | Clojure Deps do you see the correct version reported?#2021-06-0807:11katoxIf I switch it back on it says#2021-06-0807:11katox#2021-06-0808:31cflemingAnd it definitely doesn’t work with those settings?#2021-06-0809:00katoxNo, it won't starrt the REPL if I leave it on.#2021-06-0809:01katox#2021-06-0823:42cflemingThat’s really weird. I can’t reproduce that, and I don’t have a plausible theory for how it could happen. I’ll look at the code to see what debug logging might be there, otherwise I’ll have to add some.#2021-06-0907:39cflemingDoes your project have tools.deps on its classpath for some reason?#2021-06-0908:15katoxit is not on the classpath, it is in the project root. I have no idea what's wrong where but it is not a corrupted project file. I found a 6mo old untouched deps project that did the same. If you had some debug build I can try to run it here if it helps.#2021-06-0808:25AzzuriteI installed clojure.tools on Windows through scoop, but I can't use it with Cursive because the output of the clj -Sdescribe command contains invalid escape sequences:
$ cmd-clj.exe -Sdescribe
{:version "1.10.3.855"
:config-files ["C:\Users\***\scoop\modules\ClojureTools\deps.edn" "C:\Users\***\.clojure\deps.edn" "deps.edn"]
:config-user "C:\Users\***\.clojure\deps.edn"
:config-project "deps.edn"
:install-dir "C:\Users\***\scoop\modules\ClojureTools"
:config-dir "C:\Users\***\.clojure"
:cache-dir "C:\Users\***\.clojure\.cpcache"
:force False
:repro False
:main-aliases ""
:repl-aliases ""
:exec-aliases ""}
because C:\Users\... contains \U... (I know, switch to Linux...)#2021-06-0808:31cflemingHmm, that sounds like a deps bug really, since the output is supposed to be edn but isn’t readable. I’d be interested to hear if that’s something that might be fixed there - I’m not sure what Cursive could do about that.#2021-06-0812:26Alex Miller (Clojure team)Yeah, it’s a bug #2021-06-0815:00Azzurite❤️#2021-06-0812:37LitewhatHello! I have a problem with connecting to a remote REPL running on WSL from Cursive running on Windows. Every time it says "Connection refused". Do you have any idea why is it happening?#2021-06-0812:44borkdudeCan you connect using other tools, e.g. lein repl :connect ?#2021-06-0814:34Litewhat@U04V15CAJ Unfortunately I cannot#2021-06-0814:36borkdudePerhaps there is something here https://blog.michielborkent.nl/2020/07/26/remote-wsl2-clojure/
I have some powershell script that does stuff with ports in the Windows firewall, etc#2021-06-0814:37borkdudeNot sure if that is related though. Perhaps your REPL isn't listening on the wildcard address / public IP address of wsl(2)#2021-06-0815:24Litewhat@U04V15CAJ I’ve check the script you had in the video. So I proxied only a port on which the repl is listening on WSL but still cannot connect to it#2021-06-0815:26Litewhat> Not sure if that is related though. Perhaps your REPL isn’t listening on the wildcard address / public IP address of wsl(2)
I’ll check that soon#2021-06-0815:58LitewhatLooks like it’s not listening on wildcard address and I’m not sure how to do it :thinking_face:#2021-06-0816:03borkdudewhat are you using, nREPL? how are you starting it?#2021-06-0816:10LitewhatI’m using leiningen in WSL. I’m starting it with lein repl#2021-06-0816:15borkdudeSee lein repl --help how to configure the host and port#2021-06-0817:24LitewhatChecked that unfortunately when I’m setting host to 0.0.0.0 then the repl is running but I can see that it’s listening on 127.0.0.1. Also I have a postgres container which is listening on 0.0.0.0… Weird.#2021-06-0817:26borkdudeunfortunately.... it's working?#2021-06-0817:30borkdude@UCMM72RT4 This works for me:
$ lein repl :start :host 0.0.0.0 :port 1337
nREPL server started on port 1337 on host 0.0.0.0 -
#2021-06-0817:30LitewhatI’m sorry I wrote wrong#2021-06-0817:31LitewhatChecking yours#2021-06-0817:46LitewhatGood point @U04V15CAJ thank you! I used positional arguments which was wrong… So it says for me that nREPL is running on 0.0.0.0:5555. Now I can connect via lein repl :connect but I cannot with Cursive :thinking_face:#2021-06-0817:54Litewhat@U04V15CAJ solved! I restarted and invalidated cache and now I’m super happy to connect from Cursive 🙂#2021-06-0819:54borkdudecool!#2021-06-0812:53favilaHello! I’m running into an issue again where I’m in a monorepo, multiple directories have the same bare name and are deps.edn projects, and because they have the same base dirname I can’t import them as modules at the same time. I’m wondering if any workaround for this problem as emerged in the past few months (I think) since I last encountered it?#2021-06-0812:54favilaTo be more concrete: services/foo/deps.edn and modules/foo/deps.edn are different deps projects in the same intellij project#2021-06-0812:55favilaI can only have one of them as an intellj module at a time because the module name for both is “foo” and I don’t think I can control that.#2021-06-0820:49salamhave you tried manually adding and renaming those modules with the same (inferred) name in Project Structure / Project Settings / Modules ? you can add them one at a time and rename them following a naming convention (e.g., services-foo, modules-foo).#2021-06-0820:51salamhttps://stackoverflow.com/questions/29495060/multiple-intellij-maven-modules-with-same-name#2021-06-0900:36favilaCursive seems to control the module settings—the next ”import changes” will reset the names #2021-06-0904:37salamyou're right. we seem to have lost the ability to rename modules in this particular case where modules in different directories share the same name... 😞 Cursive threw 5 unhandled exceptions when i attempted to import and rename such modules...#2021-06-0904:46salamhttps://github.com/cursive-ide/cursive/issues/2391#2021-06-0814:46Jeff Evanshopefully I explained this well, but adding a sub Lein project after the fact is somehow not working as well as the initial recursive import: #2021-06-1117:32Jeff Evansleft a comment… I think the problem may have been Maven fighting with Lein#2021-06-0815:57kendall.buchananAnyone running Cursive/IDEA on the Apple M1? Thoughts on how well it performs?#2021-06-0818:04danierouxSnappy, blazing, joy inducing.#2021-06-0821:41kendall.buchananFantastic. On a Macbook Pro or Air?#2021-06-0822:48danierouxBoth. I have a 16G Air as my personal machine and a Pro as work machine#2021-06-0913:26onetomi've seen it on my colleague's machine.
it's almost as good as my 8-core i9 27" iMac with 80GB RAM.#2021-06-1419:08Nicolas Estrada@cfleming hi, is there any way to use babashka's nREPL without having noisy completion errors?
(+ 1 2)
=> 3
Error updating completions:
: Could not resolve symbol: cursive.repl.runtime/completions cursive.repl.runtime REPL:1:2
#2021-06-1503:26cflemingSadly not, but I’m working on babashka for a release soon.#2021-06-1509:07Nicolas EstradaIf there was any way I could contribute or lend a hand, let me know 😉 I'm in an elixir shop now and babashka is my only clojure work I'm going atm#2021-06-1602:46onetomi would be happy to test babashka support too.
im not using babashka extensively yet, partially because of the lack of cursive support.
but also because some of the datomic tooling doesn't work in babashka and i think functionalbytes/rmap or redelay didn't work either.#2021-06-1419:47Ian FernandezHi, there is a way to make parinfer not angry when I'm using
(defn a
[{:keys [a
b]}]
,,,,)#2021-06-1419:47Ian Fernandezlike for the keys destructuring in vector alignment#2021-06-1419:47Ian Fernandez?#2021-06-1419:48Ian Fernandez#2021-06-1422:30cflemingIf you delete the closing ], parinfer will fix it up.#2021-06-1500:19Ian Fernandezit stay like this, there's an option to align it?#2021-06-1503:26cflemingYeah: https://cursive-ide.com/userguide/formatting.html#2021-06-1513:07Ian FernandezI couldn't find an option for this type of identation#2021-06-1521:51cflemingIf you reformat your code, it should lay it out like that.#2021-06-1523:31Ian Fernandeznope, it always space to right#2021-06-1523:31Ian Fernandezit doesn't align at the same length#2021-06-1523:34cflemingAre you using a font with ligatures? Is that f there actually an fn or something similar?#2021-06-1600:24Ian Fernandezdefn#2021-06-1600:25Ian Fernandezaw#2021-06-1600:25Ian Fernandezit's the prettify symbols mode#2021-06-1600:25Ian Fernandezthanks#2021-06-1419:48Ian Fernandezright now is making this 😞#2021-06-1420:24Matthew TwomeyHey all, new to both clojure and cursive. I’d like to add a custom task to my project (lein template) in intellij (e.g. so that it shows in the leiningen task list), but it seems like no matter what I do, that task list is “immutable” 😉 Does anyone know if it’s possible?#2021-06-1420:25Matthew TwomeyIn other words, I’d like this kibit task (which works on the command line) to show up in this menu:#2021-06-1503:28cflemingRight, there’s no good way to do this right now, sorry. This is because lein makes it hard (and slow) to get the list of tasks. One thing you can do is create a leiningen run configuration which will execute that task.#2021-06-1500:47manutter51Hi @mtwomey, check out this answer on Stack Overflow: https://stackoverflow.com/questions/31175396/define-project-specific-tasks-in-leiningen#2021-06-1502:58Matthew TwomeyThanks, I am able to create the task and us it with lein from then command-line, but it doesn’t show up as a task in intellij / cursive - that’s what I’m trying to solve?#2021-06-1514:38Matthew TwomeyJust a follow on to this (in case someone comes across it later): It appears this isn’t possible with Cursive, as least at present: https://github.com/cursive-ide/cursive/issues/60#2021-06-1502:58Matthew TwomeyThanks, I am able to create the task and us it with lein from then command-line, but it doesn’t show up as a task in intellij / cursive - that’s what I’m trying to solve?#2021-06-1508:56thumbnailWhere do I enter the cursive license? I'm renewing one but can't find the option 😅#2021-06-1509:04thhellerin the help -> register cursive menu#2021-06-1512:18simongrayI wonder why regular quoting does remove highlighting of unresolved symbols, while syntax-quoting doesn’t? The content is quoted in both cases, so should it really make a difference?#2021-06-1605:19cflemingPrimarily because syntax-quoting is mostly used for code, and quoting is usually used for data. However it’s true that often the code isn’t valid, the most egregious case being CLJS macros where there’s no good way to tell if the macro is designed to generate Clojure or CLJS. This is something that I’ve gone back and forth on, and I’m open to persuasion on not marking inside syntax quotes.#2021-06-1512:24Alex Miller (Clojure team)regular quoting will just leave the symbol unevaluated. syntax quoting resolves symbols to fully-qualified symbols, so here would resolve something like ?form to your-ns/?form . I think (?) what you're seeing there is that Cursive is marking your-ns/?form as an unknown var in your-ns.#2021-06-1512:24simongrayHm… that makes sense#2021-06-1512:24simongrayIs there no way I can unquote inside a quoted data structure?#2021-06-1512:25simongrayThe only reason I went with ` is because I would like to use ~#2021-06-1512:25Alex Miller (Clojure team)I think you're asking to not resolve those symbols?#2021-06-1512:25simongrayyeah, basically#2021-06-1512:26Alex Miller (Clojure team)if so, the typical way to do that in ` is to ~'#2021-06-1512:26Alex Miller (Clojure team)so ... ~'?form ...#2021-06-1512:26Alex Miller (Clojure team)which is terrible here of course :)#2021-06-1512:27simongrayyeah, but the only reason I am using ` is because I can’t unquote inside a regular quoted data structure. The other alternative is to quote every single symbol other than written-rep, which is tedious 😞#2021-06-1512:27Alex Miller (Clojure team)there are multiple options here#2021-06-1512:28Alex Miller (Clojure team)it's important to keep in mind that this is all data#2021-06-1512:31Alex Miller (Clojure team)(into [:bgp ['?form :ontoloex/writtenRep written-rep]]
'[[?form ...] ...])
#2021-06-1512:32simongrayYeah, that’s one way to do it 🙂#2021-06-1512:33simongrayBut it seems like a workaround. It sure would be great if one could unquote inside a quoted data structure 😉#2021-06-1512:33Alex Miller (Clojure team)well you can, that's ~#2021-06-1512:33Alex Miller (Clojure team)it's the symbol resolution that you don't want#2021-06-1512:34Alex Miller (Clojure team)another option is the little-used https://clojure.github.io/clojure/clojure.template-api.html#2021-06-1512:35Alex Miller (Clojure team)you can use apply-template for something like this I believe#2021-06-1512:39Alex Miller (Clojure team)(clojure.template/apply-template '[x]
'[:bgp
[?form :ontolex/writtenRep x]
[?word :ontolex/canonicalForm ?form]
;; etc
]
[written-rep])#2021-06-1512:40simongray(apply-template '[written-rep]
'[:bgp
[?form :ontolex/writtenRep written-rep]
[?word :ontolex/canonicalForm ?form]
[?word :ontolex/evokes ?synset]
[?synset :ontolex/lexicalizedSense ?wordsense]
[?wordsense :ontolex/isSenseOf ?other-word]
[?other-word :ontolex/canonicalForm ?other-form]
[?other-form :ontolex/writtenRep ?other-rep]]
[written-rep])#2021-06-1512:40simongraythis does work, but it’s a little ugly 🙂#2021-06-1512:41simongrayMaybe a macro that quotes every symbol starting with a ? is in order?#2021-06-1512:42simongraythough that doesn’t help with cursive highlighting 😛#2021-06-1512:44simongraynevermind, I think Aristotle actually supports a bindings map, so I’ll just use that#2021-06-1512:44simongraythanks for helping out anyway, @alexmiller!#2021-06-1512:45simongrayAnd for introducting me to apply-template.#2021-06-1514:38Matthew TwomeyJust a follow on to this (in case someone comes across it later): It appears this isn’t possible with Cursive, as least at present: https://github.com/cursive-ide/cursive/issues/60#2021-06-1515:22JoelI see an old git ticket for this bug I get a lot when loading files into REPL: (https://github.com/cursive-ide/cursive/issues/1286)
Error updating class definitions:
Execution error (NullPointerException) at java.util.concurrent.ConcurrentHashMap
Is this considered unfortunately "normal"?#2021-06-1602:25onetomi've pasted the code example in the ticket into one of my freshly opened REPL tool windows and it did not print any exceptions.#2021-06-1602:26onetomIm on the Jun 8 2021 IntelliJ Ultimate EAP, with Cursive 1.10.3-eap1-2021.2#2021-06-1602:29onetomah, if I send the expression from the editor, then the error appears.#2021-06-1519:19Jeff Evansthe default auto-import does (for instance): (:import (java.time LocalDate))
is there a way to tell it instead to do (:import java.time.LocalDate) (this is to adhere to our internal style guidelines)#2021-06-1602:41onetomthere is a Preferences / Editor / General / Auto Import dialog, but it only shows settings for a few languages and Clojure is not on the list.
if this style choice ever becomes an option, i would probably expect to find it within this dialog.#2021-06-1605:21cflemingThere’s no option for this at the moment, but I have (somewhat) short-term plans for improving all the namespace rewriting stuff to make it more configurable and just all around better.#2021-06-1520:17indyIs it possible to add vars also in the breadcrumb navigation? I use breadcrumb navigation all the time when I'm writing JS. Navigating between functions becomes much faster and I can also quickly see all the vars in the ns at a glance without opening the Structure pane.#2021-06-1601:17salami use “⌘ F12” (Navigate | File Structure) to get an overview of the current namespace.#2021-06-1602:23onetom+1 for Cmd-F12, because it allows narrowing by simply starting to type a substring of the identifier you are looking for#2021-06-1603:05indyThis is exactly what I was looking for. Thank you.
It would be nice if this can also be made part of Breadcrumb navigation (`Jump to navigation bar`) like in other langs.#2021-06-1605:21cflemingI’ve asked in the JetBrains slack how to do this.#2021-06-1605:45indyNice, thank you :)#2021-06-1602:18onetom@cfleming i was reporting an issue with paren highlighting back in april:
https://clojurians.zulipchat.com/#narrow/stream/180378-slack-archive/topic/cursive/near/233632162
i've found the cause of the phenomena!
Preferences / Editor / General / Appearance / Use block caret
if it's ON, the highlighted matching paren is the unexpected one.
if it's OFF, then it works as advertised.
i tried to find a related github issue to note this finding there, but i couldn't.#2021-06-1602:21onetomi had this cursive doc page open on my machine for some reason:
https://cursive-ide.com/userguide/repl.html
and i've noticed that in the animated images, the caret was a bar, not a block. that gave me the idea#2021-06-1605:21cflemingHmm, interesting - have you searched in YouTrack? That sounds like an IntelliJ issue to me.#2021-06-1705:44onetomAdded a comment here:
https://youtrack.jetbrains.com/issue/IDEA-215291#focus=Comments-27-4965809.0-0#2021-06-1605:07shinichyIs there any way to see the detail of a test failure in REPL? I know I can see them in a tooltip, but it’s a little hassle to navigate to the test code.#2021-06-1704:11onetomthis has been discussed before, but unfortunately there is no way to do that now.
what i didn't know though, is that it's slightly easier to get to the test failure if your gutter is on and click the fail-icon there. u don't have to hover and wait at least for the dialog with the link to the diff.#2021-06-1704:13onetomotherwise, i've hooked up kaocha.repl/run to a REPL command and then assigned it to Cmd-R to conveniently run tests.
it was not a great choice of keyboard shortcut because i often restart the REPL accidentally 🙂
but other than that, it's a pretty pleasant workflow.#2021-06-1704:14onetomi wish i wouldn't need to carry a koacha setup around for every project, but that's the best i could come up so far#2021-06-1704:15onetomhere is a related issue:
https://github.com/cursive-ide/cursive/issues/2229#2021-06-1704:18onetombtw, do u know that you can run clojure tests using the same machinery provided to other languages in intellij?
u have to create a run configuration for the tests u want to run and wait for your clojure app to start up, so it's slower than a repl-based approach, but it's also cleaner, because u are guaranteed not to have any misleading REPL state affecting your tests.
it's documented here:
https://cursive-ide.com/userguide/testing.html#test-runner#2021-06-1705:27shinichyYes, the problem is starting up a REPL in my test is very slow because of a lot of initial setups.#2021-06-1705:27shinichykaocha.repl/run approach sounds interesting. I’ll try it. Thanks!#2021-06-1705:29shinichyI didn’t know that there’s already an issue. Yes, checking a diff is also another pain point. I don’t want to use my mouse to check the test result basically.#2021-06-1622:16Ian Fernandezanyone knows how to print diffs on IntelliJ when using Nubank Matcher Combinators?#2021-06-1700:38kennyI will just manually run the test in the REPL and inspect the printed output. Don't know if there's a better way.#2021-06-1704:24onetomand unfortunately the output is not as nice as using the built-in kaocha support for the = matcher.
i was just asking about this on the kaocha channel the other day and got this response:
> actuallyalys_slack: I think we could use better documentation for matcher-combinator support. I'll write up an issue.
this was my question:
https://clojurians.zulipchat.com/#narrow/stream/180378-slack-archive/topic/kaocha/near/241149364#2021-06-1712:51tobiasAre things that I println to the REPL output window stored in a log file somewhere? I performed a long-running computation (several hours) and println'd the results to the REPL with the intention of copy-pasting them once the computation was completed, but IntelliJ froze after the computation was complete and copy-paste doesn't work. I'm hoping that I can find the results in a log somewhere instead of running the whole computation again. (Note to self: next time persist the results to disk!)#2021-06-1713:22tobiasNever mind, I managed to export my results by selecting all the text in the REPL and choosing File | Print and printing to PDF, then copy-pasting from the PDF. Phew.#2021-06-1714:03Jeff Evansso, you managed to save the answer to Life, The Universe, and Everything. nice#2021-06-1722:05tobiashaha yup!#2021-06-1715:05gregCursive colours as comments anything following ; char (within a line) and forms following #_. Is there a way of colouring (comment) forms as comments?#2021-06-1804:52emilaasaAnother perspective - some people write a large percent of their code inside comment blocks and appreciate that it is highlighted like normal code.#2021-06-1903:44onetomuse #_(comment ,,,), so even if the #_ is removed accidentally, the program inside won't run, when you load the file.#2021-06-1903:51onetomI'm one of those people, who write a lot of code inside comment blocks and I think it's nuts not to do so, because it's just too easy to accidentally load a source file, full of top-level code, which might be side-effecting.
I guess most of the time it would throw some exception and most expressions would be just impure, but not side-effecting, but still feels unnecessary risk.
I can imagine that others' tooling doesn't make it easy to accidentally load a namespace, but wouldn't that mean that accessing such a basic operation is not as easy as possibly can be?#2021-06-2920:02gregoh right, I haven't thought about #_ in front of (comment... ). Thanks#2021-06-1719:28Ian FernandezError handling response - class java.lang.IndexOutOfBoundsException: Wrong line: 233. Available lines count: 171
Why I'm getting this error on running tests?#2021-06-1821:02cflemingI’m not sure, it does look like the error Jeff posted. What do your tests look like? Are you using any odd test forms, or just deftest?#2021-06-1816:09Jeff Evansrelevant? #2021-06-1902:02emccueIDK what the criteria are for being added to the macro expansion whitelist#2021-06-1903:21cflemingYou mean the stub generation?#2021-06-2019:34emccueyeah#2021-06-2210:58cflemingSo this isn’t user-configurable yet, but I’d like to make it so. Let me take a look at what would be involved there.#2021-06-1902:03emccuebut my brother is a biologist and I am trying to move him to techascent/tech.ml.dataset from R so I can help him more with his papers#2021-06-2119:38joshkhClojure + life sciences = win. shameless plug for my previous (and very much loved and open source) company, http://intermine.org. their latest webapp is in Clojure, as are its supporting API library and data table app. Clojure is such a good fit for working with biological datasets. 🥳#2021-06-2120:41salamfor some reason, i can no longer open a project that has three modules as Deps projects. whenever i open it, i get the java.lang.IllegalStateException: ModifiableRootModelBridgeImpl was already committed or disposed and com.intellij.serviceContainer.AlreadyDisposedException: Already disposed: Module: '[NAME_REDACTED]' (disposed) followed by Unable to save settings: Failed to save settings. Please restart IntelliJ IDEA error and IntelliJ IDEA becomes totally unusable. has anybody else run into this?
my environment:
IntelliJ IDEA 2021.1.2 (Ultimate Edition)
Build #IU-211.7442.40, built on May 31, 2021
Runtime version: 11.0.11+9-b1341.57 x86_64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
macOS 11.4
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 12
Registry: scala.erase.compiler.process.jdk.once=false
Non-Bundled Plugins: String Manipulation (8.15.203.000.3), com.cursiveclojure.cursive (1.10.3-eap1-2021.1), org.intellij.scala (2021.1.21)
Kotlin: 211-1.4.32-release-IJ7442.2
#2021-06-2120:44salamneither cache invalidation nor re-creating the project (i.e., deleting .idea directory, *.iml files) resolves this issue.#2021-06-2121:41cflemingHmm, no, I’m not sure what might be going on there. There have been changes in the latest IntelliJ versions to the ways that modules are synced, but I’ve not seen this one. Do you have a full stack trace in the log? Help | Show log in Finder/Explorer#2021-06-2121:41cflemingIs this a project I can look at, or is it a work one?#2021-06-2121:51salami can send you the log file. unfortunately, this is a work-related project whose code i cannot share with you.#2021-06-2122:03salamoh, actually, i was able to reproduce this problem with the following minimal, reproducible example (each of the modules only has an empty deps.edn):
~/tmp/test_project
❯ tree
.
├── idea.log
├── module_1
│ └── deps.edn
├── module_2
│ └── deps.edn
└── module_3
└── deps.edn
3 directories, 4 files#2021-06-2122:05salam#2021-06-2122:12salami'm not sure if this is redundant now that we have a MRE but here is the truncated log file just in case.#2021-06-2123:16cflemingThanks, I’ve managed to reproduce the problem with that repo setup.#2021-06-2204:45salamthis is currently blocking us from working in this repo since there's no workaround either. when can we expect a fix to be released?#2021-06-2205:03cflemingI’m not sure, I can do an EAP release as soon as I’ve identified the problem. Hopefully tomorrow.#2021-06-2210:52cflemingOk, I’m still investigating this. It’s been reported a handful of times in the error tracker but it’s obviously a fairly rare corner case because it hasn’t come up much at all. However I’m almost certain that it’s due to a platform change (or possibly a bug) in IntelliJ 2021.1. So if you need a workaround tomorrow, my suggestion would be to try downgrading to 2020.3, I suspect that the bug will not be present there. I haven’t had a chance to try it myself though, sorry - it’s getting late here.#2021-06-2304:01cflemingI’ve filed this: https://github.com/cursive-ide/cursive/issues/2563#2021-06-2200:10caleb.macdonaldblackAny ideas why “requiring” my namespaces is so slow for me in the repl? using (require '[some.namespace]) can take around 800ms for a namespace that isn’t that big and doesn’t require any other files other than external libs#2021-06-2201:43cflemingThat’s probably a question for #clojure, unless it’s very slow in Cursive and fast in a normal REPL.#2021-06-2200:10caleb.macdonaldblackstarting my whole project in the REPL takes over a minute#2021-06-2202:31Alex Miller (Clojure team)one thing you can try is to add :verbose true to your require - that will dump each ns as it loads. if one namespace is particularly slow (mostly commonly due to heavy macro usage), you can often just spot it by eyeball#2021-06-2211:25bnstvnin the Cursive REPL, whenever a huge datastructure is printed,the keybinding for “Interrupt Current Evaluation” doesn’t work for me.
The keybinding does work in the eval phase, and with mouse click I can stop the printing as well. anybody have seen this?#2021-06-2414:49potetmhmmm… it looks like autocomplete doesn’t work for clojure.data.xml aliased keywords#2021-06-2423:12cflemingHow does that work behind the scenes? Does it populate a namespace with things introspected from the schema, or something similar?#2021-06-2423:59cflemingActually, I just dug through the code a bit. Looks tricky, indeed.#2021-06-2500:48potetmYeah, it creates a namespace of xmlns.{url-encoded xmlns} and then aliases that in *ns*.#2021-06-2414:50potetm(xmln/alias-uri 'soap "")#2021-09-2107:41stijnYes, I selected the module. Just to be sure, does Cursive expect to have any specific files in the module before it sees it as a 'babashka' module?#2021-09-2107:42stijnI'm using bb.edn, I understand it doesn't support the deps (not using that), but I am using the :paths entry for putting code in "src"#2021-09-2108:38cflemingOne question - how did you create the module you’re trying to add this to? It has to be a Java module type, which most Clojure modules are. Did you create this via deps or lein, or in some other way?#2021-09-2110:07stijnah, no I just added the directory, because I don't have a deps.edn or lein file#2021-09-2110:07stijnbut I can add an empty one maybe?#2021-09-2110:08cflemingYeah, if you just add a deps.edn containing {}, right click it and “Add as Clojure Deps file” that should do it.#2021-09-2110:10stijnok yes that worked, thanks!#2021-09-2110:14cflemingGreat! I’ll add that to the doc, I’d assumed that everyone would be adding bb stuff to an existing module rather than creating a new one.#2021-09-2110:38stijnReally nice work!#2021-09-1710:03borkdude@stijn Cursive should be executing bb print-deps which prints a deps.edn which is then used to resolved local sources + dependencies#2021-09-1710:03borkdudeso it's using bb itself under the hood to detect the project deps#2021-09-1710:04stijnok, but I'm clearly missing something; when does it do this? when you run the REPL?#2021-09-1710:04borkdudeNot sure#2021-09-1710:05stijnThe thing I'm stuck at is that I need to specify a module, but I don't know how to add the bb project as a module.#2021-09-1915:55devurandomI have an odd issue where Cursive's nREPL client seems to show things that REPL-y does not: https://clojurians.slack.com/archives/C17JYSA3H/p1632066344001900
Can someone help or maybe has some idea what could have caused this?#2021-09-1921:27cflemingThat looks to me like the REPL server doesn’t support some basic Clojure functionality that Cursive requires. Any idea what the server is or how it works?#2021-09-1921:27cflemingActually, it’s possible that what’s happening is that the results of Cursive’s initialisation are being printed there, where they wouldn’t normally be. Does the REPL seem to work ok apart from that?#2021-09-1921:28cflemingIt’s possible that the server’s responses are not quite what the standard nREPL’s ones would be, and that’s causing Cursive to print the results of some internal ops.#2021-09-1922:15devurandomThe server should be a standard nREPL 0.8.3:
https://github.com/lambdaisland/witchcraft-plugin/blob/main/src/lambdaisland/witchcraft/plugin.clj#L66-L75
https://github.com/lambdaisland/witchcraft-plugin/blob/main/deps.edn#L21-L24
https://github.com/lambdaisland/witchcraft-plugin/blob/main/resources/witchcraft_plugin/default_config.edn.tmpl#L3-L10
But it uses a middleware that is supposed to execute each command in a different thread: https://github.com/lambdaisland/witchcraft/blob/main/src/lambdaisland/witchcraft/nrepl/task_eval.clj
https://github.com/lambdaisland/witchcraft/blob/main/src/lambdaisland/witchcraft.clj#L523-L526
If I disable this middleware, the mysterious output is gone.
Any idea what might be wrong with that code to modify the responses? Otherwise I'll continue poking it and read more about how nREPL works internally...#2021-09-1922:18devurandomSomething I am thinking about now, but which I will have to do more research on: Are nREPL commands supposed to be synchronous or can they be asynchronous? And does Cursive treat the nREPL connection as something stateful, e.g. switching "echo" off and on? That will be the next thing I will dig into...#2021-09-1922:22cflemingnREPL commands are asynchronous. You send a message, and get one or more replies back. Unfortunately I know next to nothing about Minecraft, so I’m not sure why it would do that - looks like there’s a standard thread commands need to be executed on, like the Swing EDT or something?#2021-09-1922:24devurandomApart from the comment in that config EDN file, I do not know anything about this, either:
> Run evaluated expressions inside the game loop, so you don't have to schedule them explicitly
But yes, I assume game code needs to be executed from the game thread, maybe because the thing is not entirely thread safe... 🤷#2021-09-1922:26cflemingI’m not really sure what that is doing. What I suspect is that either the message or session IDs are not coming back correctly. The way this works is that an ID is set on the request, and that should be provided on the response. Cursive maintains a map of response handlers for outstanding requests indexed by ID, and if it can’t find the correct handler for a response it will just use a default one. I suspect that’s what’s happening. Give me one sec…#2021-09-1922:27cflemingDrat, I thought I had debug logging to see the message contents, but I don’t…#2021-09-1922:29cflemingYou could create a middleware to do that, perhaps…#2021-09-1922:31cflemingLooks like this has been discussed here: https://github.com/nrepl/nrepl/issues/85#2021-09-1922:56devurandomThanks, that intro to nREPL helped a lot.#2021-09-1922:59cflemingNo worries, let me know if you have more questions.#2021-09-2205:36plexusThanks for the help @U0567Q30W, upon inspection it seems we were sending a :done to the eval op before sending the :value response. Would that explain this behavior? I've put out a fix.#2021-09-2205:36plexusBefore:
C ---> 11 eval {:nrepl.middleware.print/buffer-size 4096, :ns "user", :file "*cider-repl clj-projects/cauldron:localhost:25554(clj)*", :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/print "cider.nrepl.pprint/pprint", :column 7, :line 13, :code "(+ 1 1)", :nrepl.middleware.print/stream? "1", :nrepl.middleware.print/options {:right-margin 80}}
C <=== 11 #{:done} {}
C <--- 11 #{} {:value "2"}
C <--- 11 #{} {:ns "user"}
After
C ---> 11 eval {:nrepl.middleware.print/buffer-size 4096, :ns "user", :file "*cider-repl clj-projects/cauldron:localhost:25554(clj)*", :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/print "cider.nrepl.pprint/pprint", :column 7, :line 13, :code "(+ 1 1)", :nrepl.middleware.print/stream? "1", :nrepl.middleware.print/options {:right-margin 80}}
C <--- 11 #{} {:value "2"}
C <--- 11 #{} {:ns "user"}
C <=== 11 #{:done} {}#2021-09-2211:04cflemingYes, that would explain it in Cursive’s case. Cursive keeps a map of handlers for outstanding requests around, indexed by message ID. When it receives a :done message, the handler is removed from the map of outstanding requests, and any further responses for that ID will go to a generic handler. That will print out the values as devurandom was seeing.#2021-09-2211:04cflemingI’ve never come up with a good heuristic for how long to keep handlers around after a :done message, so at the moment I tidy them up immediately. I guess I could use an LRU cache and keep up to 100 of them around while they’re still receiving messages or something, but that’s getting complicated and I haven’t needed to do it yet.#2021-09-2213:50plexusI did notice working on the sideloader recently that that is an extreme case where the sideloader will respond with :done as soon as it is installed, but will then send messages to the client with the same id whenever it wants to request a resource. possibly in perpetuity#2021-09-2213:50plexusmight make more sense for it to never send :done, or only when you stop the sideloader again#2021-09-2213:51plexusbut that's not the only weird thing about the sideloader so maybe not something that concerns you much 😄#2021-09-2302:09cflemingYeah, in that case I’d definitely expect the :done message not to be received until you’re done with the sideloader.#2021-09-2319:17devurandomThanks, @U07FP7QJ0! https://github.com/lambdaisland/witchcraft/commit/5bdb56a17a17d630fbca66167fff50cda275f59b fixed the issue with Cursive. 🙂#2021-09-2009:36GGfpcIs it possible to configure Cursive to cmd+click to hugsql queries? They are linked via a :name key in a comment in the sql file#2021-09-2309:53cflemingNot at the moment, sadly, no - sorry.#2021-09-2013:49helios@cfleming the new :as-alias from clojure 1.11 isn't supported yet in cursive, right?#2021-09-2020:34cflemingNo, it’s not supported at the moment, I’ll try to get that in the next EAP build.#2021-09-2013:49helios(b isn't marked as resolved)#2021-09-2013:59Alex Miller (Clojure team)given that it was just released as an alpha, I don't know why you would expect it to be supported yet? as an alpha feature, it may still undergo changes before release#2021-09-2014:08heliosSince i'm on the EAP builds of Cursive that also can change arbitrarily, it doesn't hurt to ask 😄#2021-09-2014:09helioswhat better way of testing alpha stuff than using it? 😏#2021-09-2021:44cflemingCertainly can’t hurt to ask!#2021-09-2019:29genekimHello, all! Quick proposal for license renewal message — I got this message, shown in the screenshot. I spent ten minutes trying to figure out how to renew my personal license, to finally learn that you can only renew commercial licenses. (I kept submitting my order number and email address, to which it returned “Not found”.)
I’d like to propose clearer language in the notice: “Renew your commercial license or purchase a new personal license”).
PS: I was super delighted to purchase another license to support your amazing work! 🙂#2021-09-2020:32cflemingHi Gene, you should be able to renew a personal licence. Non-commercial ones are not renewed (you just get a new one), but personal ones definitely are. Could you drop me a mail at <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection> and I’ll sort that out for you?#2021-09-2021:15genekimRoger that! Thx!!#2021-09-2102:42kharusI can confirm I renewed personal license 2 times.
But from the website.#2021-09-2201:56genekimSuper low priority question: I am so proud of myself that for years, I have resisted mucking with IntelliJ advanced VM settings, and trying out Shenandoah GC, despite seeing spinning ball of death many many times on macOS, which I assume are GC pauses.
Has anyone actually tried this out and had success with it? (I feel like this is what only maniacs due, because they think they can tune IntelliJ better than the vendor...)
https://news.ycombinator.com/item?id=25581487#2021-09-2203:01cflemingSo, I’m mostly in the same group as you (don’t fiddle, because it’s likely that papa knows best), so I’m not sure on this. One thing to bear in mind is that they use their own JDK which is currently 11, and I wouldn’t recommend using a different one since it contains a lot of bug fixes relevant to JetBrains products. I think Shenandoah is only stable on JDK 17, right? I’m pretty out of touch, though.#2021-09-2204:53genekimThanks for convincing me not to open the hood. Danger and distraction lurk. 🙂
(Ah, you’re right. You have to switch the JVM IntelliJ uses… Which means even more danger, I’m assuming. I have plenty of danger in my life without this. 🙂
(Reminds me of people who buy fuel additives to increase fuel efficiency — an argument I found persuasive: if it actually worked (and in a way that didn’t cause long term issues), the auto manufacturers would use it, as they have every economic motivation to do so.)#2021-09-2216:49Jakub Holý (HolyJak)I have never experienced such pauses from GC (lucky?). What is however a huge problem for me is IntelliJ's beloved indexing. Every I.I. release I hope it will get better and every release I am disappointed. (Admittedly, it got better since I upgraded my Mac - but still prefer VS Code for any things I only work on shortly.)#2021-09-2722:43kendall.buchanan@U6VPZS1EK I don’t know if this is relevant to what you’re asking, but on the M1 I get a huge performance increase from using https://plugins.jetbrains.com/plugin/10044-atom-material-icons. Sounds crazy, but the rationale is here: https://youtrack.jetbrains.com/issue/JBR-3237#2021-09-2800:25cflemingThanks @U0HJA5ZQT, interestingly that link also mentions that JB are updating the JBR to Java 17 as we speak, so hopefully Shenandoah will become a thing at some point soon-ish.#2021-09-2803:03tony.kayI almost always increase my heap settings. Having a larger pool reduces certain GC times. Theoretically the larger the memory pool, the better GC works (infinite memory means no GC:slightly_smiling_face:). Of course if you make it too large you'll starve the rest of your computer for ram and slow other things down or cause swapping. I don't however, bother messing with the actual GC options. Most general purpose users on a single user app are going to be hard pressed to do anything noticable.#2021-09-2210:02indyWould be nice if Cursive also showed the differences for clojure.test/are :)#2021-09-2309:47cflemingI looked at this back in the day. I seem to recall that for some reason it’s impossible to get the required information back from clojure.test, but it’s probably worth looking at it again in case I missed something.#2021-09-2310:56indyYeah skimmed the source and looks like it. are is just a do of is '.
(clojure.test/are [x y] (= x y)
1 1
2 2
2 3
4 1)
FAIL in () (te.clj:754)
expected: (= 2 3)
actual: (not (= 2 3))
FAIL in () (te.clj:754)
expected: (= 4 1)
actual: (not (= 4 1))
Figuring out the indices of the args that failed might be difficult I think.
Sad, because I don't use are in cases I should be using it since I can't see the diffs in Cursive. Would be nice if clojure.test itself added some metadata to find out the indices of the args that failed, it would really help when there a lot of args to are.#2021-09-2216:46Jakub Holý (HolyJak)Hi @cfleming! I love Cursive, thanks for the great work!
I wonder, is there any solution for letting Cursive understand when vars are copied from one ns it another one, as is done here https://github.com/expez/superstring/blob/a24e30367b0bca2144ffd25fe78abe3cd0f42bb1/src/superstring/core.clj#L35 ? I guess it is the same case as https://github.com/cursive-ide/cursive/issues/711, i.e. not going to be supported? I would not mind having to provide some info manually - for a lib I used often it is still much better than missing autocompletion and the pesky XXXX cannot be resoled. I can imagine having some .edn in my home dir / project dir with a map mapping symbol from the lib to the original (in the case of superstring, e.g. {superstring.core/trim clojure.string/trim, ...} .#2021-09-2308:47Jakub Holý (HolyJak)I guess https://cursive-ide.com/userguide/macros.html#stub-generation would solve my problem. Would it be possible to enable it for custom namespaces???#2021-09-2309:40cflemingHi Jakub! Sorry about the slow response. There are actually a couple of forms like this which are supported, I’ll check to see if any of them look like that and could be configured with Resolve As… If not, I’d have to add some code for that. And yes, enabling stub support for custom namespaces is something I’ve considered. It would only work for namespaces from libraries, which should work for this case.#2021-09-2313:31Jakub Holý (HolyJak)thank you!#2021-09-2219:17Colin P. HillWhat does “Stub generation required” mean? I’ve got a project that keeps prompting me to generate stubs, and every time it finishes it just prompts me again#2021-09-2220:12tanzoniteblackhttps://cursive-ide.com/userguide/macros.html#stub-generation#2021-09-2220:12tanzoniteblackas to why it continually is asking, if you check the events log, is it actually succeeding? I’ve seen that behavior happen when there’s multiple log4j reporters on the classpath and it causes some oddities#2021-09-2302:11cflemingRight, if it’s not working for some reason, please find your log file (Help | Show log in Finder/Explorer) and email it to me at <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection>#2021-09-2318:47kennyThe power at my house dropped in the middle of a rebase and left my .git in a completely broken state. I just recloned my monorepo and opened it up and now the project looks totally different. Previously, my Project view in IntelliJ would show the monorepo root folder, all files within it, and and our projects folder which contains many Clojure Deps projects. Now, after reopening the project, all of the projects in the projects directory are displayed at the top level and the root directory is displayed at the very bottom, highlighted in brown. For the life of me, I cannot figure out how to get IntellliJ to recognize the top level monorepo directory as where the project starts. Does anyone here have any ideas?#2021-09-2318:57Jeff Evansusing deps.edn?#2021-09-2318:58kennyYes#2021-09-2318:58Jeff Evansmy guess is you need to right click the topmost one, and Add as Deps Project#2021-09-2318:58Jeff EvansI have this happen often when switching between branches where we converted from lein->deps#2021-09-2319:10imreyou might be able to "import project from existing sources", target the root of your monorepo, go through the import wizard#2021-09-2319:10imresaved my arse and sanity a few times#2021-09-2400:04kennyJust following up here. What worked for me was cloning the project and renaming the .idea directory temporarily. We commit .idea/clojure-deps.xml and .idea/ClojureProjectResolveSettings.xml to VCS. I then open the root directory via File > Open and finally move the two files into the newly created .idea directory. Quite the hassle. @U0567Q30W any idea why this works in this manner?#2021-09-2322:03EddieI’m considering adding a couple vars in my project that will be dynamically created at load-time via a macro. My understanding is that “stubs” are the only way for Cursive to recognize these vars. I understand from the docs that automatic stub generation is limited to a hard-coded set of namespaces, but is there a way to just manually write/specify some static stubs?#2021-09-2400:35dpsuttonYou can declare all of them if you know which ones will be created and let your load time macro handle the actual value#2021-09-2401:38EddieIn my case, there will be a different set of defn made depending on the version of one of my deps so I can’t just declare the symbols. My plan was to (hopefully) write a handful of stub files for each version of the dep that I will be using and point Cursive at those.#2021-09-2516:30thumbnailI noticed kwd is marked as unused, but it's actually used 👀#2021-09-2519:03potetmThat’s not legal clojure and cursive knows it.#2021-09-2519:03potetmwell. ish.#2021-09-2519:03potetm(require (symbol (str (namespace :foo/bar) "." (name :foo/bar))))
#2021-09-2519:03potetmis legal clojure and doesn’t highlight#2021-09-2611:38thumbnailWhat's illegal about it 👀?#2021-09-2614:29potetmRun just the require form#2021-09-2614:29potetmMy guess is that cursive has special parsing for require#2021-09-2614:30potetmAnd dynamic args are jacking with it.#2021-09-2613:29jeremysHi, is there a way to get a list of Cursive's action ids ? I am trying to use ideavim and want to map some shortcuts...#2021-09-2710:02indyThere is a Cursive section in keymaps that should list all of Cursive’s actions, I’m guessing#2021-09-2802:54tony.kayI think :actionlist shows them#2021-10-0120:15jeremysThanks, I ended up using the track action id stuff to find the ids I needed. Cheers.#2021-09-2712:21roman01la👋 Probably was asked already: Does Unused declaration inspection work in general? Doesn’t seem to be working for me no for Clojure neither for ClojureScript. Does it require a running instance of REPL?#2021-09-2721:05cflemingNo, for some reason it doesn’t for Clojure, I haven’t got around to figuring that one out. I’ll try to look at that soon, a couple of people have asked about it.#2021-09-2809:08roman01laThanks a lot 🙏#2021-09-2813:33emccueI know its old news, but is there any progress on letting us teach cursive about new macros? We have a particular thing we do in our code base that is a lot of boilerplate, but we haven't been able to make a macro because we can't find a way to fit it into any of the built in forms.
(and losing symbol resolution/click to definition would negate a lot of the benefit of what we do)#2021-09-2914:00Jeff Evansquite possibly related? https://github.com/cursive-ide/cursive/issues/147#2021-09-2914:10emccueAs far as I can see the solutions that would work would be
• A way to do this and say "this macro will give these symbols with docstrings based on this logic" similar to how clj-kondo handles it with hooks (if cursive can just take info from clj-kondo that would do just dandy)
• Stub generation for all the places we use the macro. This is only done for a whitelist of public libraries, not a knob that has been offered to users.
• Running repl supplements static analysis. Cursive has been pretty clear about not wanting to support this#2021-09-3009:38cflemingThere’s still not much to support this, sorry. However fixing it properly has been held up by some daft architectural choices I made a long time ago, but I’ve recently made some steps towards fixing those.#2021-10-0219:08imre@U0567Q30W that's great to hear. Do you see a possibility of any visible improvements in this topic in the next year or so?#2021-10-0301:03emccueI know you have a ton on your plate, but if there is anything that can be done to help with this I would be happy to#2021-09-2819:21Jim StrieterIs there any way to use Intelli-J/Cursive to generate clojure bindings for a local java project?#2021-09-2914:36the-alchemistdefine "Clojure bindings"?#2021-09-3009:39cflemingYes, I’d like to know what you’d like to happen here, as well.#2021-09-3008:26mokrHi, is there anything I can do myself to help Cursive understand e.g. re-posh/reg-sub like it understands re-frame/reg-sub, so that they show up in the “Structure” tool window , works with “find usages” and can be navigated with CMD+click?
Update: Languagees & Frameworks > Clojure > Symbol Resolution looks promising, but I just have to figure out how to add new Global/IDE entries as there is no +/add button…
Update2: I get the impression that what I want is the “Resolve _ as” functionality from context menu, but that only works for macros, not functions it seems.#2021-09-3009:37cflemingResolve as… is definitely what you want, and it should work for functions as well. Let me know if that’s not the case.#2021-09-3013:10mokr@U0567Q30W That is good news, but for some reason I get No context actions available at this location when I try to bring them up for re-posh/reg-sub in a namespace where I have required [re-posh.core :as re-posh] (latest IntelliJ and Cursive).
Then I noticed that inside the re-posh.core ns itself I get that context menu, but what should I actually resolve it as to have it work like re-frame.core/reg-sub? Trying def and defn didn’t seem to work.
Update: Got it working from inside re-posh.core ns. Had to drop the re-frame.core/ ns part when resolving as reg-sub#2021-10-0220:52cflemingThat’s really strange, I can’t see why you would need to do that. But I’m glad it’s working!#2021-09-3009:33imre@mokr I grepped my settings and it appears ~/Library/Application Support/JetBrains/IdeaIC2021.2/options/ClojureResolveSettings.xml contains these#2021-09-3012:42roklenarcicI have a leiningen project. When I run it with lein run it works normally. When I run it with IntelliJ run profile with Run with Leiningen enabled, I get:
Could not decrypt credentials from /Users/roklenarcic/.lein/credentials.clj.gpg
Cannot run program "gpg": error=2, No such file or directory
See `lein help gpg` for how to install gpg.
In console, typing gpg works as expected#2021-09-3012:44roklenarcicIs there some sort of weird path issue with IntelliJ?#2021-09-3014:18Jeff Evanswhat is your $PATH in the terminal when it works? for Lein, I think you can set custom environment variables in the tool window#2021-10-0112:15roklenarcicI’ll try that#2021-09-3013:01wilkerluciosince yesterday I start seeing cursive marking some things as unresolved, that doesn't make sense, this macro is already setup to use as let, if I refresh the project it goes back to normal, but at random times Cursive seems to be marking as unresolved in the way you can see in the screenshot#2021-09-3013:14wilkerlucionevermind, it was related to clj-kondo things, no cursive deal 👍#2021-10-0100:38Oliver GeorgeNot sure if this is off topic. Tell me if I should delete it... IntelliJ users of the world unite! We need a "git grep" style search feature. Vote here: https://youtrack.jetbrains.com/issue/IDEA-177598.#2021-10-0116:42Jeff EvansI +1ed it. Would be useful.#2021-10-0106:34JoniHi, I am not sure if this is a Cursive issue or an Idea issue, but I cannot find any good answers anywhere so here goes. I am working on a project that has multiple different repos in it, and 2 of them are common helpers which are used in the other repos through symlinks and all of this works fine, but when I start Idea it automatically adds the symlinked folders as source roots in the module settings to the common modules. This breaks the source roots and go to definitions everywhere, so every time I start Idea I need to go to the module settings and click to remove the excess content roots. Has anyone else ran into an issue like this and if so, did you manage to fix it?#2021-10-0720:56cflemingSorry for the delay with this, no, I’ve never heard of anything like that sorry. Do your other repos have the symlinks marked as source roots? i.e. in my head it looks like this: module 1 has src marked as a source root, but that’s actually a symlink pointing to module 2 src dir. The problem is that the directory in module 2 is actually the one that gets marked. Is that right?#2021-10-0720:56cflemingAre you using deps, lein or something else?#2021-10-1210:10JoniAa hey, sorry for taking some time to get back to you, we are using lein, and the structure is like
modules:
• common
• ui
• desktop (actual project that's running a repl)
• management (another separate project running a repl)
So the common and ui modules/projects are symlinked under the desktop and management projects under a folder called "checkouts" which is then excluded in the main module settings of each, so we don't have to run lein installs to get the changes made in these shared projects. And the symlinks are not marked as source roots, but the folders where the symlink is pointing to is used as a source root in the common and ui modules. I realise now that this is pretty hard to explain, as I don't have total understanding of why this is setup the way it is, and I don't have a lot of experience wrestling with Idea modules.#2021-10-1210:22JoniAa and i've just figured out that the checkouts structure is a leiningen feature where leiningen knows to fetch the used dependency from there instead and that should help if you're developing the said dependency at the same time.#2021-10-0307:02JAtkinsLow importance question: has anyone else noticed an eternal “calculating classpath” task occasionally when starting local deps repls? I have a project I’ve imported from scratch a couple times on different computers, but only one has this problem. Basically, I start a local repl, and the “Calculating Classpath” spinner starts. It seems to be an infinite hang, and it’s not cancelable. The only solution I’ve found is to reboot the IDE, but that’s inconsistent. That route requires possibly multiple restarts. I don’t see anything in the IJ logs or in the event viewer that are obviously related to this. Current workaround is starting the repl outside of IJ.#2021-10-0422:37cflemingThat’s very strange, I can’t think of anything that would cause that on just a single machine. Could you take a thread dump of the IDE when it’s hung? https://intellij-support.jetbrains.com/hc/en-us/articles/206544899-Getting-a-thread-dump-when-IDE-hangs-and-doesn-t-respond#2021-10-0503:31JAtkinsHere’s one#2021-10-0409:37heliosMaybe I'm making a stupid mistake. I have a case function which should differentiate between different symbols. IntelliJ is warning me that those symbols can't be resolved, but the documentation of case explains that
The test-constants are not evaluated. They must be compile-time
literals, and need not be quoted.
I've now switched the (case sym ...) into a (condp = sym ...) but it feels a workaround. Shouldn't case be exempt from trying to resolve things? cc @cfleming#2021-10-0409:38heliosthis is in clojurescript btw, and also the compiler throws some warnings
--------------------------------------------------------------------------------
32 |
33 | (defn explain [sym]
34 | foo "foo"
35 | bar "bar")
---------^----------------------------------------------------------------------
Use of undeclared Var my.ns/bar
#2021-10-0409:54imreAre you having troubles with case or defn?#2021-10-0409:55imreThe defn example sure isn't valid unless you have foo and bar defined globally#2021-10-0411:40emccue(defn explain [sym]
(case sym
foo "foo"
bar "bar"))#2021-10-0414:01imreah I see now#2021-10-0414:32helios@U3JH98J4R yes sorry i typed it wrong, but you're right 😄#2021-10-0421:50cflemingYes, Cursive should definitely not complain about that.#2021-10-0413:21roklenarcicIs there a way to disable maven in clojure projects? My build keeps generating pom.xml files and then Intellij complains that Maven and Leiningen cannot both manage the module#2021-10-0421:52cflemingThat should only happen if Maven thinks it’s managing the module, it won’t import the pom by default. If you open your Maven toolwindow and remove the project from there it should stop pestering you.#2021-10-0413:21roklenarcicEffectively it disables leiningen on the module, giving precedence to maven#2021-10-0413:26roklenarcicI still have problem where all the leiningen preparation tasks run with a weird PATH. And then I always get Cannot run program "gpg": error=2, No such file or directory. It works fine from command line.#2021-10-0422:31cflemingDoes this work if you set the gpg path at Preferences | Build, Execution, Deployment | Build Tools | Leiningen?#2021-10-0512:26roklenarcicyes entering full path here helps#2021-10-0512:26roklenarcicthanks#2021-10-0511:29imre@cfleming FYI https://github.com/cursive-ide/cursive/issues/2593#2021-10-0521:07cflemingThanks, I’ll fix that for the next EAP.#2021-10-0605:10imreThank you very much!#2021-10-0514:29seriogaHello @cfleming
In the code
(ns user.cursive-ns-alias
(:require [clojure.string :as string]))
(let [{:keys [string/x]} {:string/x 0}]
x)
Cursive thinks that string in :keys [string/x] is an alias of clojure.string. This affects such functionality as “ns alias usages” and “rename keyword”. Should I create a ticket for this?#2021-10-0520:56cflemingYes, please - good catch.#2021-10-0612:06seriogaOK, the issue has been filed https://github.com/cursive-ide/cursive/issues/2596#2021-10-0621:19cflemingThanks!#2021-10-0515:30JHi! I have a strange behaviour. When a use the function Run Test Under Caret in Repl the first time, the test ran but if I use the same function twice no test found (`0 test, 0 assertion`) I must kill and reopen a new repl. Do you have an idea what’s going on?#2021-10-0720:51cflemingHmm, no, I’ve never seen anything like that. Does it happen for all tests? What about in different projects?#2021-10-0813:32JNo just on one project. Maybe I miss a configuration.#2021-10-1419:43JHi! @cfleming This is a screen video of the weird behaviour.#2021-10-0517:10Colin P. HillAnyone have any keymap recommendations for IntelliJ and Cursive on Mac? Using default bindings for both the IDE and the plugin, I’m running into a bunch of collisions – both between the IDE and the plugin, and between both and the OS. I’ve been remapping things as I run into them, but if anyone’s found that some other keymap works better out of the box, I may just cut my losses and make the switch.#2021-10-0611:15indyI tend to use emacs like keybindings where there are first strokes and second strokes, the keybindings palette expands significantly this way.
Example, I use ^ + C as the first stroke and ^ + M as the second stroke to invoke the Manage Projects actions.#2021-10-0612:45heliosI second Emacs-like keybindings#2021-10-0612:58Colin P. HillI’ll give that a try, thanks!#2021-10-0614:18imrehttp://mishadoff.com/blog/idea-for-clojure/ is a good starting point for mnemonics-like ones, https://github.com/imrekoszo/dotfiles/tree/master/settings/IdeaIC-current/keymaps are based on that#2021-10-0612:06seriogaOK, the issue has been filed https://github.com/cursive-ide/cursive/issues/2596#2021-10-0604:24royalaidhey @cfleming I am trying to use cursive inside a larger team repo. Because I am the only one using cursive we would like to keep the idea files out of the main repo. The problem I have is that everytime I update my deps.edn and sync it breaks the idea configuration#2021-10-0604:31R.A. PorterAre you sharing disk space or using version control software? I would hope and assume the latter; in that case, just add your IJ project files to either your global ignore file (e.g. .gitignore if using git) or to local ignite files.
If the former case, I strongly advise that you explain to your team the value of DVCS.#2021-10-0612:45heliosI know this is not what you asked, but we are also mostly .gitignoring the .idea folder BUT having a few files actually checked in for consistency: indentation settings and whatnot. But everybody has their own .idea folder#2021-10-0615:43royalaidWe are using DVCS, hence why I referred to a repo. Again my main problem is that syncing the deps.edn with intellij breaks the modules that have been added to the project.#2021-10-0615:50R.A. PorterPerhaps I don't understand why you said, "we would like to keep the idea files out of the main repo", then.#2021-10-0615:53royalaidBecause I am the only one using intellij, it just adds noise the PRs and diffs#2021-10-0615:54R.A. PorterRight. Which is why @U0AD3JSHL and I both suggested using .gitignore Then your IJ files would still be where they belong but not be in your PRs and shared repository.#2021-10-0615:57royalaidAgain, its not about where the project files live. That isn’t an issue. The issue is specifically if I right click my deps.edn and sync new dependencies the project loses modules#2021-10-0615:57royalaidDo you have a solution to specifically, that?#2021-10-0615:58R.A. PorterI do not. Good luck.#2021-10-0616:41royalaidFound what I think is the problem, or part of it. The issue seems to be cursives assumption that the deps.edn files will live next to the intellij iml. We have frontend setup with two sub projects that use a parent directory to house their deps.edn#2021-10-0621:19cfleming@U0S3YK6HK Can you share the directory structure of your project along with where the deps.edn files live? I’m not sure I understand how you have this set up. If you’d prefer to email to <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection> and discuss offline that’s fine too.#2021-10-0604:25royalaidadd to this that the project uses a monorepo with multiple modules that nested under other modules and it seems to run into a lot of cases that cursive assumes work but do not#2021-10-0604:25royalaidI am sure a major part of this is me not understanding how to use intellij’s project config but I can’t imagine my modules should get nuked on refreshing deps#2021-10-0616:41royalaidFound what I think is the problem, or part of it. The issue seems to be cursives assumption that the deps.edn files will live next to the intellij iml. We have frontend setup with two sub projects that use a parent directory to house their deps.edn#2021-10-0710:46Rachel WestmacottMinor issue: defs with names containing $ e.g. (defn fmt-$ [my-amount] ...) seem to not be visible to cursive. Perhaps a regex issue on the name?#2021-10-0713:16onetomi think i've encountered that $ issue too, but im not 100% sure.#2021-10-0720:45cflemingInteresting, I’ll check that out and see if I can reproduce it.#2021-10-0710:51Rachel WestmacottMinor issue 2: Extend Selection (Ctrl+W by default I believe) is inconsistent in this case (thing "string"|) (where | is the caret). Compare this to the case where "string" is anything other than a string to see the inconsistency, e.g. a number, symbol or collection literal.#2021-10-0710:51Rachel WestmacottMajor issue: Cursive is great and more people should be using it.#2021-10-0713:15onetomthere is no space printed after reader tags in the cursive REPL pane.
on a terminal REPL there is a space after reader tags.
is it like that for others too?
is that intentional?
is there a configuration option somewhere which affects this?
#inst "2020"
=> #inst"2020-01-01T00:00:00.000-00:00"
@(def my-rmap (rmap my-data-map))
=> {:foo #rmap/rval??, :bar #rmap/rval??}
#2021-10-0720:47cflemingI don’t think it’s intentional, and I don’t think there’s a config flag for it. Does it affect anything or is it just an aesthetic issue?#2021-10-0806:49onetomit's just a readability issue; hasn't interfered with anything else so far.
i was just updating rmap docs, so i was copy-pasting from the REPL to a README and that's why it became a temporary annoyance.#2021-10-0713:36helios@cfleming I'm seeing quite frequently some issues with IntelliJ/Cursive and rendering. I can't exactly tell you when the problem starts, but at some point i get some strange highlighting in forms. As i scroll through the document with my cursor, it looks like the font-weight changes. Only restarting the IDE seems to fix it. I can try to make a video to highlight the problem, but it's very unpredictable. Have you ever seen anything like it? I think this happens after the laptop has been sleeping / resuming activities a few time (FWIW, MBP 2019 16", using always the dedicated graphics card)#2021-10-0713:52heliossent you a mail with the video#2021-10-0714:20onetomI'm using Cursive on MacBook Pro (15-inch, 2017) for a few years and never experienced issues with font weight changing unexpectedly.
I'm on macOS Big Sur 11.6 (20G165) at the moment, but used both release and EAP versions of intellij with earlier macOS versions too.
I also used IntelliJ on external non-HiDPI and HiDPI screens; no issues.
Font weight specifically (and even font style) can change depending some settings in your theme for highlighted parenthesis pairs, so that's something which can be unexpected while u r scrolling by changing your cursor position.
I hope these statements might trigger some ideas, like looking for suspicious IntelliJ extensions or having some graphics related kernel extension (like SwitchResX) or screen sharing software or some unusual font, which triggers some edge cases in the font rendering engine.#2021-10-0714:21onetomare you using the official JetBrains JDK or some generic, off the shelf one? because i've seen crazy behaviour on non-jetbrains patched JDKs.#2021-10-0720:43cfleming@U0AD3JSHL I’ll reply over here so that others can see the conversation. Unfortunately I’ve never seen anything like that. Are you on the IntelliJ EAP? I’ve sometimes found the font rendering to be worse in the EAPs but it’s generally fixed in time for the release. I’d suggest filing a YouTrack issue at http://youtrack.jetbrains.com, JetBrains are usually pretty responsive over there.#2021-10-0720:44cflemingAnd yes, definitely use the JetBrains JDK in case you’re not for some reason.#2021-10-0810:18helios@U086D6TBN yeah i understand, there's something going on because restarting IntelliJ fixes this behavior.
@cfleming yeah running on EAP, but this is not something new. It's occurring more often now#2021-10-0810:19cfleming@U0AD3JSHL Definitely time for a YouTrack issue then, I think.#2021-10-1005:30onetomonce i've restored a macos installation from a time machine backup (iirc moved the setup from a macbook to an imac) and i've experienced very strange behaviours. certain shortcuts just didn't work. the font rendering was different too and i couldn't get into the bottom of it, so i've ended up reinstalling the system (which i hardly ever do...)
just saying, to add to the list of oddities, which might lead to unique/rare experiences.#2021-10-0720:29Colin P. HillDoes Cursive have any features to support transforming a :refer :all require into one that uses an alias? And if not, what’s the best way to submit a feature request? Would be a nice complement to the existing “Rename…” support for namespace aliases.#2021-10-0720:50cflemingThere’s an old issue here requesting the opposite, with a comment that both directions would be nice. I’m planning to do some work on general namespace manipulation soon. https://github.com/cursive-ide/cursive/issues/863#2021-10-1009:41Oded HassidiHi, I have recent version of cursive with intellij. and when trying to run test with “Run with Leiningen” I get this “Deferred configurations cannot be run with standard runners” any idea?#2021-10-1020:13cflemingCan you send a screenshot of your test run configuration please?#2021-10-1112:36Oded HassidiThanks#2021-10-1311:21Oded Hassidi@U0567Q30W can u please help?#2021-10-1321:06cfleming@U01HHEGLQAX Does this happen with all your test configs? When I’m back at my computer I’ll try to see if I can reproduce this.#2021-10-1321:06cflemingDoes it happen in other projects, or just this one?#2021-10-1405:54Oded Hassidiall of them, this is running tests. but running repl runs ok#2021-10-1020:18cfleming@onetom (and others) - I’m hoping to get the next EAP out this week, and that has better support for Code With Me. The REPL is shared and the structural editing/navigation commands now work. There are still things that don’t work, but it’s getting more usable.#2021-10-1201:56steveb8n@cfleming fwiw I’m excited about the prospect of using Code with Me. thanks for focusing on this#2021-10-1211:03Jakub Holý (HolyJak)I have a really long (deftype ...) defined on a single line. I select it and run the Reformat Code command and expect it to format it - but nothing happens. Why?#2021-10-1212:13imreCursive's reformat doesn't add linebreaks as far as I know#2021-10-1212:18GGfpcIs there a way to use the repl while the execution is paused on a breakpoint?#2021-10-1220:54Jeff Evansthe evaluate window works then#2021-10-1220:55Jeff Evansalthough the trick is you will have needed to require the namespaces you want to use beforehand#2021-10-1311:57miikkaI seem to have a new REPL issue. On this old Boot-based project, if I start a nREPL, connect to it with Cursive, and try to load some code, I'm getting somewhat arbitrary exceptions about namespace not found. However, if I first connect with boot real -c and load code, it works fine when connected with Cursive.
Everything worked just fine last week when I last worked on this project but this morning I upgraded IDEA to 2021.2.2 and Cursive to 1.11.0-2021.2, so I suspect the upgrade broke something.#2021-10-1401:12cflemingHi Miikka, can you provide some more detail on what you’re doing to load the code? Send file to REPL, or sending forms? Also, what does the exception look like?#2021-10-1510:43miikkaHi Colin! It seems that I don't even need to load any code. Simply connecting the REPL (with remote Clojure REPL run configuration using nREPL in Cursive) seems to trigger the problem actually. In the terminal where I'm running Boot, a huge backtrace pops up. It's not always the same; I tried it now twice and got these ones: https://gist.github.com/miikka/5aee7dffbddb60e72bad5c1f66a92750#2021-10-1510:45miikkaIf the answer is "don't use Boot", I understand that. We should absolutely migrate this to Leiningen or deps.edn.#2021-10-1510:49cflemingHmm, I suspect that probably is the answer, sorry. Those are some extremely strange errors, and I really have no idea what might cause them.#2021-10-1510:49cflemingSorry I don’t have a better answer.#2021-10-1403:01nodenameI’m trying to add a run configuration for Reveal as described in https://vlaaad.github.io/reveal/#cursive but “Run with Deps” is greyed out. Why is it greyed out?#2021-10-1403:32cflemingHow did you create the project? That option is only available for projects imported from a deps.edn.#2021-10-1416:23nodenameOK no it was not created that way#2021-10-1415:19octahedrionsometimes when I start a REPL I can't send forms inside comment blocks to the REPL, instead it sends the entire parent comment. I don't know what I'm doing differently when this happens because usually it does what I expect and sends the outermost non-comment form to the REPL#2021-10-1419:46cflemingI’ve been meaning to test this, but I think that this happens if you send the form when it’s indexing.#2021-10-1812:59octahedrionit's not that - it's not indexing#2021-10-1813:28octahedrionthough it could be related to indexing - I did "refresh clojure deps..." and got an exception regarding indexing which I've reported to Cursive. I'm now doing invalidate caches and restart...#2021-10-1813:29octahedrionI also noticed that I had no code-completion for that project#2021-10-1813:31octahedrionok invalidate caches & restart fixed it#2021-10-1813:32octahedrionand fixed the code-completion too#2021-10-1813:33octahedrionit's annoying having to restart IntelliJ but all's well that ends well#2021-10-1419:43dvingoit depends on where your caret is placed#2021-10-2008:00octahedrionno it doesn't. There are 2 ways to send forms to the REPL, send current form and send form before caret. I'm talking about the former which can break if indexing is broken#2021-10-1505:04Oliver GeorgeQuick sanity check. Is there a way I can avoid being completely "off the map" with my js interop. Example below from a namespace (we use shadow-cljs). Bit shouty for my taste.#2021-10-1505:42cflemingUgh, sorry, I’ve been meaning to make an interim fix to this for the longest time (as well as a more definitive fix, of course). I’ll try to get that into the next EAP.#2021-10-1505:04Oliver George#2021-10-1823:14nodenameI’ve managed to break Cursive’s ability to open a REPL. I believe I clicked “Restart REPL” and it didn’t restart, and now when I try to open a REPL I get a grey pane with “Nothing to Show” in it. Is there a way I can restore REPLing to Cursive?#2021-10-1919:50wilkerlucio@cfleming hello, I'm experiencing a case where my project is refreshing forever, it just says Reading Project, but seems stuck there for a long time, this project worked before, the issue started after I add two new deps to deps.edn, I have those same deps in other projects without issues, is there a way I can see some debugging info to understand whats going on?#2021-10-1919:56Alex Miller (Clojure team)does it work at the terminal?#2021-10-1919:56Alex Miller (Clojure team)(probably want a -Sforce if you check)#2021-10-1923:35cflemingYes, I’d check that first, I can’t think of anything in Cursive that would cause that, it just calls out to deps.#2021-10-2019:54wilkerluciodidn't got to try on terminal, but it was a git dep, when instead I made a released and used the maven version, it worked fine, I'll do a check on the terminal for it#2021-10-2020:57wilkerlucio@U064X3EF3 I just tried running from terminal, and it works as expected there (also tried loading the lib from the REPL)#2021-10-2020:57wilkerlucioits a git dep, in a project that has 3 different deps.edn modules#2021-10-2019:55wilkerlucioI'm noticing in a project that the auto-complete for keywords is using different contexts for CLJ and CLJS (a keyword that's on CLJ file doesn't show in completions on CLJS), is this intended? I believe would be better to have keywords shared across CLJ/CLJS#2021-10-2020:25wilkerlucioactually, not about CLJ vs CLJS, but about different modules in the same project#2021-10-2100:51wilkerlucioI'm seeing a strange hightlight behavior, as I move my cursor over the keywords it gets some parts green that make no match with the current keyword#2021-10-2100:53wilkerluciofull file contents: https://gist.github.com/wilkerlucio/f598716ae10345895cb56076dba98eaf#2021-10-2109:15imreI also noticed this, not specific to keywords#2021-10-2109:16imreIntelliJ IDEA 2021.2.3 (Community Edition)
Build #IC-212.5457.46, built on October 12, 2021
Runtime version: 11.0.12+7-b1504.40 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.6
GC: ParNew, ConcurrentMarkSweep
Memory: 4029M
Cores: 8
Registry: scala.erase.compiler.process.jdk.once=false
Non-Bundled Plugins: net.seesharpsoft.intellij.plugins.csv (2.17.1), com.intellij.plugins.watcher (212.5080.8), Key Promoter X (2021.2), StringToolsPlugin (4.0), de.thomasrosenau.diffplugin (2.1.7-SNAPSHOT), com.jetbrains.plugins.ini4idea (212.5457.59), org.intellij.plugins.hcl (0.7.14), dev.monogon.cuelang (0.8.2), com.namespace.sort.namespace-sort-plugin (1.6-imrekoszo), name.kropp.intellij.makefile (212.5457.59), mobi.hsz.idea.gitignore (4.3.0), String Manipulation (8.19.203.000.0), org.intellij.scala (2021.2.23), org.jetbrains.kotlin (212-1.5.31-release-546-IJ4638.7), com.cursiveclojure.cursive (1.11.0-2021.2)
Kotlin: 212-1.5.31-release-546-IJ4638.7
#2021-10-2119:26markaddlemanI recently started using https://github.com/hyperfiddle/rcf . It's pretty nice. I'd love to configure Cursive to treat its tests macro the same as clojure core's comment macro for the purposes of sending the top form to the REPL. Under Cursive's current behavior, only (inc 1) form is considered the top form:
(comment
(inc 1) ; <- cursor in this form
(inc 2))
Whereas, the entire (tests ...) form is considered the top form:
(tests
(inc 1)
(inc 2))
As a default behavior, this makes sense. However, I don't think there's currently a way to tell Cursive to treat tests the same as comment#2021-10-2121:42cflemingI’ll check this - I’m not sure if it’s possible to resolve-as a form as comment. I’m also not sure you’d want that, since it disables some functionality inside comment blocks. Could you file an issue for that?#2021-10-2315:43markaddlemanhttps://github.com/cursive-ide/cursive/issues/2600#2021-10-2315:44markaddlemanThanks for Cursive!#2021-10-2320:28cflemingGreat, thanks!#2021-10-2400:15emccueIf I make a custom data reader for css, could we make intelliJ do syntax highlight in the string?#2021-10-2404:15cflemingDefine “we” 🙂#2021-10-2404:18cflemingThe short answer is: it’s possible, but tricky.#2021-10-2412:40AJ Jaro@U3JH98J4R is that for a certain file type? You can create a custom editor for that file type and that editor can have your syntax highlighting, yes#2021-10-2415:45emccue@UGMAVSMUM I was thinking of looking into css directly in cljs files#2021-10-2415:47emccueso instead of page.css and page.cljs having
#css "
.some-class {
color: red;
}
"
(defn component []
[p.some-class "hi"])#2021-10-2415:52emccueon the scope of “features i wish we had” - ability to declare macros that introduce new symbols is still more directly useful - but there might be some compile checking of css classes that we could get from something like this#2021-10-2416:37emccueAnd "we" in this context is the engineers I work with#2021-10-2508:24wotbrewOh I would love this for SQL/GraphQL#2021-10-2620:28cflemingTo answer the original question - I don’t know very much about language injection, but I believe there’s a mechanism by which users can configure where languages should be injected. I’ll try to figure this out, and I might be able to make it flexible enough for that case.#2021-10-2400:16emccueI.E.
#css "
p {
color: blue
}
"#2021-10-2416:23GGfpcHow do I run all tests in a package with cursive?#2021-10-2504:28cfleminghttps://twitter.com/CursiveIDE/status/1452492161253986305#2021-10-2508:47imreNice improvements!#2021-10-2513:00wilkerlucioawesome! I'm just trying the new :as-alias support, I see when I use Cursive now correctly completes the keyword with it 🙌#2021-10-2513:01wilkerluciobut seems like the IDE still marks that as an error (yellow background)#2021-10-2520:22cflemingHmm, thanks, I didn’t see that, I’ll check it.#2021-10-2613:31imreI'm unable to get https://github.com/cursive-ide/cursive/issues/2026 work btw#2021-10-2620:48cfleming@U08BJGV6E do you have an example?#2021-10-2620:48cflemingBasically, as long as the key and value are not on the same line, that should work.#2021-10-2709:35imre@U0567Q30W basic case:#2021-10-2709:36imrecomplex case:#2021-10-2709:37imreIt could be that I don't properly understand how this one should work, perhaps you have a counter-example?#2021-10-2709:38imreIntelliJ IDEA 2021.2.3 (Community Edition)
Build #IC-212.5457.46, built on October 12, 2021
Runtime version: 11.0.12+7-b1504.40 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 11.6
GC: ParNew, ConcurrentMarkSweep
Memory: 4029M
Cores: 8
Registry: scala.erase.compiler.process.jdk.once=false
Non-Bundled Plugins: Key Promoter X (2021.2), StringToolsPlugin (4.0), dev.monogon.cuelang (0.8.2), com.jetbrains.plugins.ini4idea (212.5457.62), com.intellij.plugins.watcher (212.5080.8), mobi.hsz.idea.gitignore (4.3.0), org.intellij.plugins.hcl (0.7.14), de.thomasrosenau.diffplugin (2.1.7-SNAPSHOT), name.kropp.intellij.makefile (212.5457.62), com.namespace.sort.namespace-sort-plugin (1.6-imrekoszo), org.jetbrains.kotlin (212-1.5.31-release-546-IJ4638.7), com.cursiveclojure.cursive (1.12.0-eap1-2021.2), org.intellij.scala (2021.2.23), String Manipulation (8.20.203.000.1)
Kotlin: 212-1.5.31-release-546-IJ4638.7
#2021-10-2510:04octahedrionI have "default to only indent" and "force only indent for all forms" selected but still structural editing moves like raise and splice reformat code, which I don't want. For example, splicing a pair of forms out of a vector into a parent map within a map will reformat the entire root map, and it's someone else's code so I don't want to change their formatting.#2021-10-2520:25cflemingHmm, I think that’s hard-coded at the moment and can’t be controlled. I’m going to re-work the structural actions soon and I can fix it then - could you file an issue so I don’t forget?#2021-10-2608:40octahedrionok thank you!#2021-10-2513:50Ivar RefsdalHm. When I do "Search REPL history" IntelliJ/Cursive crashes and logs me out (!).
Not sure when this started happening.#2021-10-2520:39cflemingHmm, that’s very strange, do you mean that the whole application crashed? If so that sounds like a bug in IntelliJ or the JBR. I’m not sure there’s much I can do about that in Cursive itself, unfortunately.#2021-10-2705:05onetomif i press cmd-opt-e, while my cursor is in the REPL tool window's expression input area, the Search history popup appears as expected.
however, if i do cmd-shift-a "repl his" enter, the popup appears briefly, then disappears and the latest history entry is pasted into the input area, as if I had pressed enter twice.
and indeed, if i click on the Search REPL history menu item in the action menu, the search popup appears and stays active.#2021-10-2705:06onetomThe Previous/Next REPL History Item actions also doesn't work, regardless of how I try to execute them (via shortcut or from the action menu)#2021-10-2705:57cflemingHmm, interesting, I’ll check those.#2021-10-2707:27Ivar RefsdalFor my case it (search REPL history) works in one project, but (yes) crashes and logs me out in another project.
Maybe this is related to that the search popup is bigger than the monitor it ends up on?
I've been mixing dual and single monitor setup.#2021-10-2720:57cflemingYes that could be. I’ve been meaning to make fixes to that so the window doesn’t get out of control. I’d say that's the most likely candidate, it’s probably hitting a bug in the window rendering or something similar.#2021-10-2805:56Ivar RefsdalAny easy way to clear the REPL search history?#2021-10-2513:54Ivar RefsdalI'm using 1.12.0-eap1-2021.2#2021-10-2605:24shinichyIs there a way to evaluate an expression after local nREPL is started? I’d like to achieve the same behavior as -e option of clj command.#2021-10-2605:24shinichyI just found a feature request https://github.com/cursive-ide/cursive/issues/2038#2021-10-2611:24Mateusz MazurczakHi, when I run load file in repl for cljs files. I get wrong path sent to a repl (it is just sending absolute path /home/user/.../ instead of src/..)
Can I change sent to repl path manually to send shorter path?#2021-10-2620:54cflemingHmm, I think this should work - what type of REPL are you running? (clojure.main, nREPL, etc)#2021-10-2713:39Mateusz MazurczaknREPL#2021-10-2720:58cflemingDoes this happen for all files?#2021-10-2613:45helioshow can i force cursive to regenerate stub? after upgrading intellij+cursive all datomic stuff looks unresolved#2021-10-2620:53cflemingYes, I need an explicit action to allow this. Currently the best way to force it is to refresh your project using either the lein or deps toolwindow.#2021-10-2705:13onetomi usually do Cmd-Shift-A "ref dep" Enter to run the Refresh Clojure Deps Project action.
i need it so rarely, i didn't feel like i would need to come up with some shortcut key for it.#2021-10-2705:57cflemingWhat I meant was that that there should be an action to check the stubs without having to refresh the project.#2021-10-2613:49heliosI think there is an error with two projects open. Let's say A or B. I have the window of B open and i get the prompt for generating stubs. I see that is generating stubs for project A (or at least that's what i see in the bar at the bottom of the screen with the activity)#2021-10-2613:49heliosand then no stubs are still present#2021-10-2613:49helioshaving only one project open fixed it for me, maybe a bug, @cfleming?#2021-10-2620:54cflemingHmm, that could be. Are the stubs for the same dependency (e.g. datomic)? Could you file a bug with some repro info, please?#2021-10-2615:37Shantanu KumarHi, is there a way to set CLJ_CONFIG env var for a deps.edn project in Cursive?#2021-10-2620:29cflemingAs Alex mentioned, you can do this for run configs, but you can’t do it for project resolution. You definitely should be able to, and I’ll fix this.#2021-10-2620:30cflemingThere’s a request for this at https://github.com/cursive-ide/cursive/issues/2212, I’ve just set it for the current EAP cycle and I’ll fix it there.#2021-10-2615:39Alex Miller (Clojure team)you can set env vars on run configurations#2021-10-2705:09onetomhas the error formatting in the REPL window changed in the latest cursive?
it has pretty colors and nicely indented now.#2021-10-2705:09onetom#2021-10-2705:10onetomor is this the consequence of something else customizing the exception reporting format?#2021-10-2705:54cflemingThat looks like Aviso pretty to me. Cursive will use it if you have it installed and loaded.#2021-10-2811:19imreHow exactly can this be used? I tried putting pretty on the classpath, then doing
(throw (ex-info "foo" {:bar 1} (Exception.)))
(pst)
but not getting this nicer display#2021-10-2816:34onetomi ran ((requiring-resolve 'io.aviso.repl/install-pretty-exceptions)) - as mentioned here: https://ioavisopretty.readthedocs.io/en/latest/exceptions.html#io-aviso-repl - and then both (clojure.repl/pst) and the Print Last Exception Cursive action is printing nicely.#2021-10-2816:35imreooh so it isn't as simple as putting it on the classpath#2021-10-2816:35imrethanks!#2021-10-2816:35onetomfor me it was pulled in by midje, through nubank/matcher-combinators, because i forgot to exclude midje:
{nubank/matcher-combinators {:mvn/version "3.3.1"
:exclusions [midje/midje]}
...
like this#2021-10-2816:36onetomwell, mr fleming did say: if u have it installed and loaded#2021-10-2816:38imreyeah, I wasn't familiar with this lib at all#2021-10-2817:02onetomi saw it ages ago, probably in https://github.com/bhauman/rebel-readline , but since it was pulling in a lot of deps, i ignored it, because cursive was already enhancing exception printing
since then machines got more ram and more powerful cpus, so maybe it's not such a bad idea anymore to use this by default :)#2021-10-2823:20cflemingYeah, the namespace has to be loaded, since there’s no simple way to check if something is available on the classpath or not.#2021-10-2823:24cflemingCursive will also use clj-stacktrace if it’s loaded.#2021-10-2901:47onetomi think these would be great selling points for Cursive.
i would worth mentioning them on the website and include screenshots too.
it could definitely help me to win some ppl over to Cursive.#2021-10-2901:50cflemingSounds good, I will do.#2021-10-2906:21imreJust out of curiosity, wouldn't requiring-resolve be a simple enough way to chexk?#2021-10-2908:25cflemingThe problem is that if it's not on the classpath, then it'll search it every time an exception is printed. Perhaps that's not a big deal, but I assumed anyone wanting to use it would have loaded it somewhere.#2021-10-2910:49onetomthere must be some caching going on in requiring-resolve, because subsequent calls take almost no time:
(time (requiring-resolve 'io.aviso.repl/install-pretty-exceptions))
"Elapsed time: 157.880319 msecs"
=> #'io.aviso.repl/install-pretty-exceptions
(time (requiring-resolve 'io.aviso.repl/install-pretty-exceptions))
"Elapsed time: 0.037877 msecs"
=> #'io.aviso.repl/install-pretty-exceptions
(time (requiring-resolve 'io.aviso.repl/install-pretty-exceptions))
"Elapsed time: 0.032688 msecs"
=> #'io.aviso.repl/install-pretty-exceptions
#2021-10-2923:18cflemingRight, but that's if it's present on the classpath. I’m not sure how long that would take if it had to search for it but couldn't find it each time.#2021-10-2705:18onetom@cfleming You typically get negative feedback, so here is a positive one 🙂
I'm using 1.12.0-eap1-2021.3 on macOS Big Sur for 2 days now and I have no issues so far.
I don't use tools.build yet though.
Everything feels smoother and snappier on this latest IntelliJ EAP release compared to the latest non-EAP one.
I really love the new map formatting logic too!
We are one step closer to a uniform Emacs and Cursive code formatting experience!#2021-10-2705:55cflemingGreat, thanks - I also love positive feedback 🙂 Great to hear it’s going well. I’m going to look more in-depth at formatting soon, that’s some of the oldest code in Cursive and it could do with a dust-off. As part of that I’m going to make cljfmt compatibility a priority.#2021-10-2709:06octahedrionpeople usually only give feedback when something's wrong I guess, well let me also say I'm delighted with Cursive & been using it since the start, good job @cfleming#2021-11-0210:54Ivar RefsdalI also totally dig Cursive! Great job @cfleming !#2021-11-0220:33cflemingThanks everyone!#2021-10-2711:40dazldhey people - I'm trying to setup clj-kondo via the LSP method, but I don't seem to be able to see the reported issues from kondo in the IDE - what am I missing? hovering shows either the previously setup static issue, or documentation.#2021-10-2711:41dazldie, I don't see the linting feedback. maybe this is better for #clj-kondo too 🙂#2021-10-2711:47dazldanswering my own question - the IDE was configured to not show errors, I had to go and change the options in the top right:#2021-10-2712:14ericdalloBTW have you tried the LSP plugin with clojure-lsp? :)#2021-10-2809:02dazldnot yet!#2021-10-2809:02dazldbut clojure-lsp is excellent, and i've used that with emacs very succesfully (ty for that btw, eric!)#2021-10-2812:36ericdalloCool, you are welcome!#2021-10-2818:44Otto Nascarellahey @UKFSJSM38… I have tried it yesterday, but the intellij lsp plugin dies quite quickly.
if I try and use clj-kondo command line, it also dies. it needs to be the special server build provided by @U04V15CAJ#2021-10-2818:45borkdudehmm, the difference is binary vs JVM there?#2021-10-2818:49Otto Nascarellait seems so, @U04V15CAJ#2021-10-2818:50borkdudewhat do you mean by "it dies", can you give some example output?#2021-10-2818:50Otto Nascarellait times out. even if I give it 60s to start#2021-10-2818:51borkdudebut you say on the command line it also dies?#2021-10-2818:52ericdallo@U5B8QSSC9 did you try increasing the plugin timeout?
https://clojure-lsp.io/clients/#intellij#2021-10-2818:52Otto Nascarellano, no! sorry for the misunderstanding.
it does not work in integration with the LSP plugin.
even the normal standalone jar does not talk nicely to it.
it needs to be the clj-kondo-lsp-server one#2021-10-2818:52ericdallothe first time clojure-lsp starts, it can take one minute or 2 depending on the project#2021-10-2818:52ericdallothe next times it caches#2021-10-2818:53Otto NascarellaI’ll give it a huge bump and see…#2021-10-2818:56Otto Nascarella> even the normal standalone jar does not talk nicely to it
I mean… the lsp plug in does not talk nicely to lsp 🙂#2021-10-2818:58Otto Nascarella#2021-10-2819:00Otto Nascarellaalthough that message showed up, now it’s green @UKFSJSM38
and the highlighting I was getting from clj-kondo are also working ✌️#2021-10-2819:01ericdallothat message means lein classpath or clojure -Spath failed, it depends of your project type#2021-10-2819:01ericdallocheck clojure-lsp log for more details https://clojure-lsp.io/troubleshooting/#server-log#2021-10-2819:02ericdallohttps://clojure-lsp.io/troubleshooting/#classpath-scan-error#2021-10-2815:03RyanHas anyone had any luck getting language injection to work in strings? Specifically, I'd love to get GraphQL highlighting, even if I have to specify language with comment.#2021-10-2815:43wotbrewI believe this was discussed here in the context of data readers: https://clojurians.slack.com/archives/C0744GXCJ/p1635034544008200#2021-10-2819:57Ian FernandezHi, I'm having problems on configuring a leiningen project that has projects inside it#2021-10-2819:59Ian FernandezError reading ...../project.clj
Cannot run program "clojure" (in directory "...,"): error=2, No such file or directory
error=2, No such file or directory
#2021-10-2820:00Ian Fernandezgetting this error#2021-10-2820:00Ian Fernandezwhen I'm configuring the modules on project structure top level module is not being detected as a leiningen project, even having project.clj when I click on the module with right button and add this#2021-10-2820:00Ian Fernandez#2021-10-2820:00Ian Fernandezit gives me that error#2021-10-2820:05tanzoniteblack@d.ian.b, I’ve seen this error a number of times when using the lein-tools-deps plugin for lein. It’s a path issue with how intellij is executing the lein command, in some environment where the clojure program isn’t findable. You can fix it by setting an executable path option in the lein settings: https://github.com/RickMoynihan/lein-tools-deps#clojure-executables#2021-10-2820:05Ian Fernandezthanks 🙂#2021-10-2820:05Ian Fernandezi'll try to do that#2021-10-2820:09Ian Fernandezit worked @tanzoniteblack! 😄 thanks#2021-10-2820:09tanzoniteblack👍#2021-10-2821:28djblueCross posting this here for those who might be interested: https://clojurians.slack.com/archives/C0185BFLLSE/p1635455070000900#2021-10-2821:30markaddlemanVery#2021-10-2903:13onetomi've commented on the original thread. we would love to see this. we used reveal from time to time, but it was a little bit heavy and it's definitely annoying that it opens a separate window.#2021-10-2910:47tlonistIs there any way to show REPL with presentation mode from intellij?#2021-10-2916:42salam@cfleming i started getting these exceptions from a socket repl:
Error handling response - class java.lang.IllegalArgumentException: No implementation of method: :err of protocol: #'cursive.repl/Handler found for class: nil
Error handling response - class java.lang.IllegalArgumentException: No implementation of method: :out of protocol: #'cursive.repl/Handler found for class: nil
Error handling response - class java.lang.IllegalArgumentException: No implementation of method: :out of protocol: #'cursive.repl/Handler found for class: nil
IntelliJ IDEA 2021.2.3 (Ultimate Edition)
Cursive: 1.12.0-eap1-2021.2#2021-10-3004:57cflemingDid anything change about your project that might have caused that?#2021-10-3005:06salamhm… good question. i cannot think of anything special in the project that would cause this. it’s a regular remote socket REPL server that i started using -Dclojure.server.repl="{:port 5555 :accept clojure.core.server/repl}".#2021-10-3005:07salamusing the latest version of Clojure#2021-10-3005:11salamyou may find the full stack traces and other data from the reports that i submitted within IntelliJ IDEA when this exception was thrown. #2021-10-2922:10buttergunsHi @cfleming. I have a Leiningen project imported using Cursive. The project.clj contains the following dependencies:
[com.mycompany/my-maven-project "5.3-SNAPSHOT"] ; Maven
[com.mycompany/my-leiningen-project "5.3-SNAPSHOT"] ; Leiningen
For both of these: the Sources exist within my IDEA project.
When I import the project.clj the my-leiningen-project is declared as a Module Dependency. However the my-maven-project is declared as a JAR Dependency.
I would like them both to be Module Dependencies.
1. Is that possible?
2. Am I doing something wrong?
Thanks!#2021-10-3004:56cflemingUnfortunately this isn't supported at the moment. Could you file an issue and I'll take a look at fixing that? No promises, it may be difficult.#2021-10-3019:15buttergunshttps://github.com/cursive-ide/cursive/issues/2608#2021-11-0111:19cflemingThanks!#2021-10-3013:09onetomI was giving a quick try to the Code With Me feature, to see, if it would be possible to utilize my powerful office machine from home, through my less powerful laptop.
Here are the issues, I’ve encountered immediately:
1. Load File in REPL action is assigned to Opt-Shift-L JetBrains Client-EAP, instead of Cmd-Shift-L, like on the sharing session host machine
2. Jump to REPL Editor action doesn’t do anything, even when I invoke it with its Cmd-\ shortcut. What does work at least, is Cmd-E "repl" Enter
3. Cursive REPL commands are not available, so I can’t run my Kaocha tests conveniently
4. Edit REPL Commands action says: This action is not yet implemented in the JetBrains Client
5. Search REPL History action (`Opt-Cmd-E`) pops up the search window on the host machine, not the client machine.
6. If I Send ... to REPL something, it switches *ns* to the namespace of the file I was sending the expression from. I don’t have clear feedback about this because the REPL editor area is just a simple, 1-line high input field, which I can’t resize.
7. Can’t navigate by namespace (there is no Namespace tab the search everything popup)
8. There is no Refresh Clojure Deps Projects action
So these would be the features, which would allow me to work remotely seamlessly.
But if I understand correctly, for this purpose, the JetBrains Gateway is going to be a more suitable solution, so I might not care so much about the Code With Me support.
What I was hoping, is that I can avoid spending money on the latest MacBooks and just utilize some remote machine, which either a pay-as-you-go type of cost OR I already have a really powerful i9 iMac in the office, with 80GB RAM, which I'm more than happy with already.#2021-10-3013:24onetomthe usages popup also has some graphical artifacts#2021-10-3013:32onetomvery impressive solution otherwise; very snappy too!
and the JetBrains Client "only" consumes about 1 GB of RAM, as opposed to the 3 GB IntelliJ on the host machine.
most ppl would think that's hardly a difference, which would worth the trouble, but unfortunately, on Mac's, with 8 GB or even 16 GB RAM, that is likely the difference between starting to rely on swap or not...#2021-11-0111:20cflemingThanks for the report, I’ll update https://github.com/cursive-ide/cursive/issues/2602, try all those out and ask JetBrains about the ones that aren’t already in that list.#2021-11-0114:05SKi! when using cursive for debugging, how to use the parameter of an anonymous function in intelliJ's "Evalute" window? I've tried using "%" but for that it says "unable to resolve %". In the "Variables" windows this parameter is listed as "p1--52131#" however it is not working with this name in the Evaluate window. Any ideas?#2021-11-0121:24cflemingHmm, good catch - I don’t think this is possible right now. I think you’d have to refactor your anonymous function to fn to do this.#2021-11-0119:29indyI seem to have to explicitly switch to the ns for the REPL command to resolve the selection, maybe the Execute in original namespace setting is what I need but that is disabled for all commands except for when Re-execute last command is on. Can the Execute in original namespace also be allowed to be toggled on for other REPL commands?#2021-11-0306:09onetomI, personally, don't really understand your question.
Maybe that's why others hasn't reacted yet either.
But it looks interesting what you are trying to do, so I would like to understand what are you up to.
so this command would evaluate whatever text is selected.
copies the prettified form of it into the clipboard.
then returns the evaluation result.
this much is clear.
in other words, this command would behave, like the built-in Send Top Form to REPL or Send Form Before Caret to REPL, but also puts the prettified evaluation result into the clipboard.#2021-11-0306:53indyOkay maybe a screen recording might help elaborate this convenience issue.#2021-11-0306:55indyThe convenience issue is that, I have to Switch REPL to current NS for my custom REPL command to work as expected otherwise it won’t resolve the var. This is in contrast to the usual Send Form to REPL commands.
It’s only a convenience issue and not anything major, just wanted to highlight it.#2021-11-0308:02onetomI was just thinking about a similar action this other day and had the idea of decomplecting the evaluation from the clipboard operation.
I think regardless of which namespace you are evaluating something, clojure.repl/*{1,2,3} will be updated, so you could just have an operation, which puts the pretty-printed *1 into the clipboard.#2021-11-0308:08onetomalso, maybe u can utilize something like (in-ns ~file-namespace) yourself.
i wonder if there is already something off the shelf, which can eval an expression within a namespace, without affecting *ns*...
would (binding [*ns* ~file-namespace] ~selected-form) work?...#2021-11-0308:09onetomfor other readers benefit, these special ~something variables are documented here:
https://cursive-ide.com/userguide/repl.html#repl-commands#2021-11-0308:11onetomi just remembered that i've done something like this before#2021-11-0308:13onetomend that Copy *1 to clipboard command was defined as ((requiring-resolve 'gini.clipboard/write) *1), where that clipboard/write fn was using java's built-in AWT, just to be cross-platform.
but then i just discovered a few days ago, that such code is also available here:
https://github.com/AvisoNovate/pretty/blob/master/src/io/aviso/clipboard.clj#2021-11-0308:15onetomhere is the code of the Open *1 in browser action, in case anyone wants to try:
(if (and (string? *1) (re-find #"^http|file" *1))
((requiring-resolve 'clojure.java.browse/browse-url) *1)
(throw (ex-info "*1 was not a `file://` or `https?://` URL" {:*1 *1})))#2021-11-0313:20indyThanks @U086D6TBN, I’m going to try the binding suggestion or explore in that direction, which if it works will solve my exact problem. And TIL clojure.java.browse. Usually for dev things like browsing a URL or opening a certain type of file with the correct app on a mac, I’ll simply do (clojure.java.shell/sh "open" file-path) .#2021-11-0313:22onetomI also work on macOS mostly, but trying to be cross-platform, so we can run the same code on Linux CI servers too.#2021-11-0313:25onetomI even have a direnv wrapper around clojure.java.shell/sh to make sure I have the same exact software on the path, regardless of the OS. I have an .envrc for every project, which has use nix , which ensures the environment I've declared in the shell.nix file in the same project directory.#2021-11-0217:54Shantanu KumarCan anyone share pointers on how to switch from stable to EAP version of Cursive?#2021-11-0217:55Shantanu KumarI downloaded the EAP ZIP - how to install it now?#2021-11-0218:01imrehttps://cursive-ide.com/userguide/#choosing-to-receive-eap-beta-builds#2021-11-0218:11Shantanu KumarThank you, @U08BJGV6E#2021-11-0219:29Shantanu KumarIn deps.edn projects {:mvn/version "_"} doesn't seem to be auto-resolving to the latest current version - is there a way to enable that?#2021-11-0220:02imreIs the issue isolated to cursive? Does it work if you run clojure -Srepro -Stree from the command line?#2021-11-0220:35cflemingGood question, I wasn’t aware that was a thing. I’d also be interested to know if that works from the command line.#2021-11-0220:37imre; clojure -Srepro -Stree -Sdeps '{:deps {org.clojure/clojure {:mvn/version "_"}}}'
Error building classpath. Could not find artifact org.clojure:clojure:jar:_ in central ()#2021-11-0220:39imreLooks like it isn't a thing, which is consistent with how I know Alex & co.#2021-11-0221:02Shantanu KumarThanks, @U08BJGV6E maybe it's a project specific config that I mistakenly considered a clj tool feature.#2021-11-0221:33Alex Miller (Clojure team)That’s not a thing. You can use “RELEASE” (that’s a Maven thing), but be aware that breaks the deps cache#2021-11-0306:01onetomwhat does "breaks the deps cache" mean?
im aware, that using RELEASE as a coordinate results in checking for the latest version often (or always) at process startup, which can be very slow, depending on the quality of the network connection.#2021-11-0312:52Alex Miller (Clojure team)It's actually the opposite - the classpath cache looks good and will not be recomputed so you'll never see new versions#2021-11-0315:22onetomah, I probably mixed it up with how the SNAPSHOT versions behave.#2021-11-0315:33Alex Miller (Clojure team)more accurate than "breaks the cache" is "breaks the assumptions of the cache"#2021-11-0315:34Alex Miller (Clojure team)which is that a version is immutable and fixed#2021-11-0309:38henryw374I've now got clojure-lsp configured with intellij and I'd like code->reformat within a file to use clojure-lsp format instead of Cursive's formatting... and failing to see if that's possible.
Or if there is some way to import clojure-lsp's formatting style into cursive that'd also work for me.
Thanks#2021-11-0309:58henryw374there is an lsp option to 'always send requests' which apparently should mean the ide sends the command to the lsp even if the ide/plugin supports it already. but that doesnt seem to work for formatting afaict#2021-11-0310:08henryw374clojure-lsp format is using https://github.com/weavejester/cljfmt btw.#2021-11-0312:26ericdalloIt'd be nice to have that option on cursive :)#2021-11-0315:27onetomcljfmt could be just bundled with Cursive directly, since it's written in Clojure too, BUT
1. how well does it deal with invalid Clojure syntax?
2. how would the cursor position survive the reformatting?
3. how would the formatting of selections work? (alignment-wise, relative to the context of the selection)#2021-11-0610:41henryw374Any thoughts @U0567Q30W?#2021-11-0820:59cflemingMy plan here is to have an easy way to configure the Cursive formatter to be cljfmt-compliant. It’s actually hard to use an external formatter in IntelliJ since the formatting is deeply integrated in areas you wouldn’t expect (for example, when you press enter, where the caret should move to is calculated using the formatter). I’m interested to hear about cases where the current Cursive formatting can’t be made cljfmt-compliant, or other differences that are annoying.#2021-11-0821:00cflemingImporting a cljfmt spec and configuring Cursive appropriately is an obvious requirement that isn’t there currently.#2021-11-0822:15henryw374Sounds awesome 👍#2021-11-0314:17roklenarcicI’ve got a project that has project.clj and pom.xml . The pom.xml is the sideeffect of making a jar, but the IntelliJ complains that Maven and Leiningen cannot both manage the project and it keeps preferring Maven. Is there a way to fix this?#2021-11-0320:24cflemingI think what you need to do is unregister the project with Maven. In your Maven toolwindow, remove the registered project there, and then make sure that it still appears in your Leiningen toolwindow. If it doesn’t, you might need to re-import the project.clj again (right click -> add as lein project)#2021-11-0418:55GGfpcIn cursive, when I left click a test and click run-test-in-repl what exactly is happening under the hood?#2021-11-0508:46cflemingDo you mean that you put the caret inside a test and then use REPL->Run ‘some-test’ in REPL? If so, Cursive works out the var for the test you’re in, and then sends some code which is roughly equivalent to https://github.com/clojure/clojure/blob/b8132f92f3c3862aa6cdd8a72e4e74802a63f673/src/clj/clojure/test.clj#L797-L830 (but predates it so doesn’t use it)#2021-11-1017:42GGfpcIs there a way I can call that from the repl instead of having to right click?#2021-11-1017:42GGfpcLike calling (run-test my-test-name)#2021-11-1100:16cflemingNo, this would require communication from the REPL server to the IDE, which is something I have planned but isn’t there yet.#2021-11-0511:51mike_ananevI'm experiencing a constant problem: Idea+Cursive hangs too often.
Idea 2021.2.3, Cursive 1.12.0-eap1-2021.2 (stable version behaves the same), Clojure CLI version 1.10.3.998
Steps I made:
1. Open one project
2. Open another project (never mind what project is)
3. See message about Synchronizing project
4. Idea is not responding...#2021-11-0512:31onetomu havent mentioned which OS are you on and I can't really tell from the screenshot.
although the structure of the filename suggests, it's probabyl macOS, but which version of macOS?
i don't have hanging issues on this macOS Monterey setup with the EAP version of IntelliJ and Cursive:
IntelliJ IDEA 2021.3 Beta (Ultimate Edition)
Build #IU-213.5605.12, built on November 3, 2021
IntelliJ IDEA EAP User
Expiration date: December 3, 2021
Runtime version: 11.0.13+7-b1751.16 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.0.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Registry:
ide.allow.merge.buttons=false
editor.show.notification.after.reformat=false
Non-Bundled Plugins:
AceJump (3.8.3)
com.4lex4.intellij.solarized (2.4.0)
indent-rainbow.indent-rainbow (1.6.2)
org.jetbrains.plugins.localization (213.5605.12)
mobi.hsz.idea.gitignore (4.3.0)
name.kropp.intellij.makefile (213.5605.12)
AWSCloudFormation (213.5605.12)
org.toml.lang (213.5605.12)
ru.adelf.idea.dotenv (2021.3.0.213)
PlantUML integration (5.7.2)
com.dmarcotte.handlebars (213.5605.12)
com.cursiveclojure.cursive (1.12.0-eap1-2021.3)
com.intellij.plugins.html.instantEditing (213.5605.12)
Kotlin: 213-1.5.10-release-949-IJ5605.12#2021-11-0515:15mike_ananevMacOS Big Sur 11.6#2021-11-0520:45cflemingSo when this happens, the whole IDE locks up? If that’s the case, check for the automatically generated thread dumps: https://intellij-support.jetbrains.com/hc/en-us/articles/206544899-Getting-a-thread-dump-when-IDE-hangs-and-doesn-t-respond. If you have some there from recent hangs, please bundle them up and email them to me at <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection>#2021-11-0511:56mike_ananevIf I kill an Idea app and reopen any project everything works fine, until next hang.#2021-11-0513:48Colin P. HillI'm trying to get Cursive to recognize the functions defined in honeysql.helpers. They use a macro, defhelper, which looks like defn except that it creates an additional arity with an extra parameter beyond the explicitly declared ones. Adding a custom resolution so that it resolves as defn works until I get to an invocation which uses that extra parameter, at which point Cursive complains about the arity. How can I get Cursive to resolve these correctly?#2021-11-0521:01cflemingYou can’t unfortunately. If you could file an issue for it, I’ll look at adding support in Cursive until you can do that yourself.#2021-11-0815:02Colin P. HillAh, I see the problem...we're on an old version of honeysql! Still want an issue, or are old versions out of scope for Cursive support?#2021-11-0820:57cflemingIf it’s not an issue in the latest version then no, I’d just wait for that to cease being a problem.#2021-11-0520:16folconHow does cursive decide which files to send when you call Sync Files in REPL \ Load File in REPL with nrepl? Does it wait for nrepl to respond in some way before sending the next file along? I'm evaling at the top namespace in a project, and it appears to only be sending my utils namespace, which is one the namespaces that requires no other files in my project, so it makes sense that would be the first ns sent, but I'm wondering why nothing else seems to be being sent...#2021-11-0521:14cflemingSync files will look at all modified files, and then send those files and all their modified dependencies in dependency order (i.e. dependencies before the files that depend on them). Load File does pretty much the same, but does it just for the file you invoke it on whether that file is modified or not.#2021-11-0600:58folconHmm, not sure why, but when I'm launching a new remote repl I only seem to be sending my utils.clj, it's not a big issue, as I've got a work around of calling load-file for my core ns, which seems to cause all my other files to load, but I'm surprised as it normally just works.
I'm listening to the nrepl messages to determine that none of the other namespaces are sent. This is on clojure-clr, but I'm not using any specific behaviour, so a bit puzzled why it's happening. The behaviour worked perfectly, but appeared to break yesterday...
Thanks for the heads up @U0567Q30W 😃#2021-11-0606:28cflemingThat does sound odd. I’m not in front of my computer but IIRC there’s some debug logging you can turn on to get a better idea of what’s happening and why. When I can I’ll send some info (assuming my memory is correct)#2021-11-1110:58onetomi would also be interested in some debug logging related to file loading/syncing.
i keep experiencing inexplicable situations, which i can't reliable reproduce or comprehend.
i did identify one pattern, which contributes to this mysterious behaviour.
if i (def some-data ...) in NS1 and def some other value, derived from some-data in NS2, then changes of same-data in NS1, will not trigger the re-computation of the derived value in NS2.
it sounds obvious that one shouldn't do this and use functions instead, but it's easy to fall into this trap...
one example, which i was just fixing yesterday, would be to have a malli schema, which we use for generating a datomic schema. it doesn't change during the regular operation of the program, but during development, obviously it does.
until we had only one file containing both the malli and the derived datomic schema as defs, everything was fine.
no so much, after moving the computed datomic schema into other namespaces...#2021-11-1121:06cflemingI’ve checked the code and there isn’t any debug logging around this, but there should be. I’ll add that for the next build.#2021-11-1121:08cfleminghttps://github.com/cursive-ide/cursive/issues/2612#2021-11-0720:56jfntnHi there, is it possible to configure intellij/cursive to automatically refresh deps and reload the repl when it detects a deps file change?#2021-11-1110:49onetomim not sure it's possible to define precisely what is a deps file change.
if u switch to a branch with a different deps file, then it's obvious, but when you are editing the deps file manually, it's unclear when are you in a state, when you would wish to reload a REPL.
you might also have auto-save and save-on-focus-lost enabled, which means even when you are mid-edit of a deps.edn, but you switch to an another application, your REPL would be reloaded? i don't think that's very intuitive, nor desirable.
then, it's also not clear which REPLs would you restart. if you enabled running multiple instances of the same REPL config, then you might not want to restart all of them.
if you are starting your REPLs from a terminal and only connecting to them from Cursive, then what behaviour would you expect?
it sounds to me, that this would be a rather niche feature and doesn't worth the effort of introducing some flags and documenting them, with all the above mentioned limitations...
i know, it's not the same, but maybe the add-lib clojure tool might cover some of your use-cases. i don't know much about it, but i would start here:
https://github.com/seancorfield/dot-clojure/blob/develop/deps.edn#L93#2021-11-0823:56Oliver George@cfleming seems to me refactoring to change a require alias should be blindingly fast - it only needs to look in one file. What I see is slow and seems to involve some kind of full project scan.#2021-11-0905:48cflemingDo you mean a rename of the alias? That’s possible, yeah, I’ll see if I can fix that.#2021-11-1100:19cflemingI looked into this, and unfortunately it’s not trivial to fix. When the rename dialog pops up you can select “Current File” there, and it should work as expected, but there is no way to change what that scope defaults to so you’ll have to do it manually every time. Fortunately I guess this is an uncommon operation, but it’s not ideal.#2021-11-1105:34Oliver Georgethanks for looking into it.#2021-11-1105:35Oliver GeorgeWish it was uncommon for me. Perhaps my particular brand of developer OCD is uncommon :-).#2021-11-1110:35onetomthat full-project scan also made me uneasy too.
it gives the impression, that something else might have changed in some other files too.
but it's comforting to know, that it's just some framework limitation 🙂#2021-11-0823:56Oliver George(just feedback in passing)#2021-11-1013:45Kari MarttilaOccasionally I have some annoying issue using Cursive which I just haven't been figured out what I am doing wrong.
I have a Clojure REPL running in a terminal. I connect to this backend RELP using Cursive Run configuration: nREPL. Everything is working just fine.
Occasionally I want to experiment with some function X in namespace Y. I change REPL to this namespace (using Switch REPL NS to Current File) and *ns* shows that I'm in namespace Y).
Now I load everything in the editor (in namespace Y) into REPL (`Load File in REPL`).
I have a comment block. In comment block I have some test data. Now I evaluate the test data. Then I call some function X in that namespace with that test data. Everything works fine.
I experiment more. Suddenly the same function X call with the same data gives me error, e.g.:
Execution error (IllegalArgumentException) at y/x .
Don't know how to create ISeq from: clojure.lang.Var$Unbound
If I evaluate the function X, and the test data separately, I can see that there is a binding.
At this point I don't restart the terminal REPL, but I click the Restart REPL button in the Cursive REPL window. I once again switch REPL to this namespace Y and load everything in the editor into REPL. Everything works once again just fine.
This is a bit annoying. I'm 99% sure this is not a Cursive bug but I have something wrong in my work flow.
I'd appreciate any help how to investigate what is happening in my workflow and how to fix this issue.#2021-11-1013:48Kari MarttilaThe rubber duck effect works. I just now realized after writing this that I might have unconsciously hit my Integrant-reset hot key in my laptop. This probably causes this. I need to investigate this a bit. But if you have some hints I'm happy to hear about them! 🙂#2021-11-1013:57Kari MarttilaI just managed to get this error after hitting my Integrant reset button. But the weird thing is that
(keys (ns-publics *ns*))
Shows the same bindings before and after the Integrant reset, but after the reset I get this clojure.lang.Var$Unbound error.
I have done a few years Clojure development but I'm not a Clojure guru. I asked about this in the Metosin slack and someone said that he remembers to experience something similar which was a bit weird.#2021-11-1014:11henryw374if you do switch to ns again, does that fix it?#2021-11-1014:28Kari MarttilaNo. And the weirdist thing is that this does not happen immediately after hitting Integrant reset - possibly it has nothing to do with it.#2021-11-1014:29Kari MarttilaUnpleasent to debug this since it behaves as if there is some non-deterministic behaviour, even though my brain says that it cannot be non-deterministic.#2021-11-1014:30henryw374what came to mind is if doing a clojure.tools.namespace.repl/refresh, the ns gets removed and recreated. wondered if somehow you had a stale reference to deleted var#2021-11-1014:31Kari MarttilaPossibly something like that.#2021-11-1015:42onetomi also tried to mix the usage of ctnr/refresh with the cursive load file / sync files in repl and ended up with inexplicable situations.
but when i work with defprotocols or deftypes, it would be really nice to be able to unload the NSes with those definitions and reload every other NS, which used the previous definitions of those protocols and types.
alternatively, it would be good to have some guides about how to structure a program, which relies on these abstractions, in way, that makes it easy to develop them.
im still not sure i comprehend everything in https://functionalbytes.nl/clojure/lifted/protocols/2020/06/11/lifted.html for example, but i have the feeling, it might help with my issues... :/#2021-11-1015:57Colin P. HillOne of spec's value propositions is that fdef adds information to the docs generated for a function, but Cursive's documentation popups don't seem to incorporate this information. Are there plans to add this?#2021-11-1100:01cflemingYes, Cursive should definitely do this.#2021-11-1100:47kennyI've noticed that the Cursive test diff viewer does not let me use paredit to navigate, edit, select, etc. I thought it used to do that, but I could easily be misremembering. Regardless, it'd be great to get paredit support in the test diff viewer.#2021-11-1103:47cflemingHmm, interesting, thanks - I’ll check that.#2021-11-1104:48cfleminghttps://github.com/cursive-ide/cursive/issues/2611#2021-11-1104:48cflemingI’ve fixed that for the next build.#2021-11-1115:43kennyAwesome!#2021-11-1108:56octahedriondoes IntelliJ index directories like .idea and .cpcache by default and is it best to mark them as excluded in project settings > modules ?#2021-11-1121:08cflemingYes, they should be excluded. I assume that IntelliJ marks .idea as excluded by default, Cursive should do the same for .cpcache.#2021-11-1208:29octahedrionbut when I start a new project or import one, .idea and .cpcache are grey not red, which I assume means they're going to be indexed. It doesn't make sense for IntelliJ to index its own metadata but then IntellIj is very keen on indexing everything it can so it wouldn't surprize me in the least if it did#2021-11-1111:46R.A. PorterI'm trying to load-file with an eval in my ~/.clojure/deps.edn so I can have a repo of common fns I use. I have this alias that is including in the aliases run with my project...
:my/dev {:extra-deps {djblue/portal {:mvn/version "RELEASE"}}
:main-opts ["-e" "(load-file,(str,(System/getProperty,\"user.home\"),\"/.clojure/dev.clj\"))"]}
and when I take a look at the REPL process, I can see the eval at the end:
clojure.main -i /private/var/folders/t6/1fg1jgsj64qfwwq081d8f6498r5sw6/T/form-init15371867233491097436.clj -e (load-file,(str,(System/getProperty,"user.home"),"/.clojure/dev.clj"))
but the namespace isn't loading into my REPL.
I've tried other evals - basic assignment, prns, etc. - to see if those work and none of them seem to be either.#2021-11-1117:16djblueI think another option is to have a project directory which would make a namespace available on the classpath, then require could find the file for you:
:my/dev
{:main-opts ["-e" "(require 'dev)" "-r"]
:extra-deps
{my/dev {:local/root "/Users/<user>/repos/dev"}}}#2021-11-1117:17djblueWhat I did notice is without the "-r" the repl process dies so I wonder if that is the underlying issue you are running into?#2021-11-1117:19djblueI wonder if you could/should add the ~/.clojure directory as a local/root thinking-face#2021-11-1117:23R.A. PorterIt's picking up my ~/.clojure/deps.edn okay. And I was able to add an extra-path to a subdir of ~/.clojure and put a user ns in there (as long as I didn't have one in my project to override). It seems to be something specific to eval. I'll try your suggestion above, but if eval doesn't work at all, I don't think that'll be any better.#2021-11-1117:27djblueIs the main mechanism for starting your repl clojure.main?#2021-11-1117:33R.A. PorterYeah. Through whatever hoops Cursive jumps.#2021-11-1117:48R.A. PorterIt's the eval. I've tried your suggestion with a project root and also just as an extra-path and once I get to the repl, I can require in the ns. I just can't get it to run with the eval flag to clojure.main. ¯\(ツ)/¯#2021-11-1117:49R.A. PorterI can at least get myself 80% of the way there for now. That's something.#2021-11-1121:10cflemingDoes this work with a bare Clojure REPL on the command line? i.e. is this a problem with Cursive’s REPL or a more general one?#2021-11-1123:37R.A. PorterRun at the command line with
clj -M:dev:my/dev
Where the :dev alias is in my local deps and the :my/dev alias is defined in ~/.clojure/deps.edn as
:my/dev {:extra-deps {djblue/portal {:mvn/version "RELEASE"}}
:main-opts ["-e" "(load-file,(str,(System/getProperty,\"user.home\"),\"/.clojure/dev/dev.clj\"))" "-r"]}
And where that dev.clj being loaded lives where it's specified, it loads correctly and the fns in the namespace are available.#2021-11-1123:42R.A. PorterAnd one last test...run with the command
clj -M:dev -e "(load-file,(str,(System/getProperty,\"user.home\"),\"/.clojure/dev/dev.clj\"))" -r
The file also correctly loads and the fns in the namespace are available.#2021-11-1408:48cflemingThanks, I’ll try to repro this.#2021-11-1114:41Colin P. HillThe Clojure code style settings include a "Docstring fill width" field, but when I format a file, it doesn't seem to reformat my docstrings to wrap at that width. Is this a bug, or am I misunderstanding something?#2021-11-1408:48cflemingDocstrings aren’t filled as part of the reformatting, there’s an explicit “Fill Paragraph” action that uses it.#2021-11-1513:18Colin P. HillAh I see – for some reason I thought it would be a context action (I think Goland had it as one by default, maybe that's what set my expectation), but I see it in the action list. Thanks!#2021-11-1521:00cflemingIt’s probably a good idea to add a context action for that, actually - could you file an issue for that, please?#2021-11-1521:37Colin P. HillSure, done! https://github.com/cursive-ide/cursive/issues/2614#2021-11-1521:37cflemingThanks!#2021-11-1117:57simongrayI recently dropped some coffee onto my old Macbook and now I have a new Apple silicon replacement. Just installed Intellij+Cursive but I am getting a whole bunch of "Cannot execute: Clojure command not configured" errors. For the record, Clojure is installed and works fine in Terminal.#2021-11-1118:33tanzoniteblackhttps://cursive-ide.com/userguide/deps.html#macos-and-linux did you already see this FAQ helper?#2021-11-1121:12cflemingRight, I think you’ll have to reconfigure deps as described in that section for Cursive to pick it up.#2021-11-1121:13cflemingPeriodically dropping coffee on your laptop sounds like a good plan!#2021-11-1121:38simongrayThanks!#2021-11-1121:41simongray@U0567Q30W Yeah, insurance covered it all, so other than having to wait for Apple to deliver it's been a pretty nice experience.#2021-11-1117:59simongrayIt's a deps.edn project I've opened in Cursive (from existing sources).#2021-11-1117:59simongraythe Clojure CLI was installed via homebrew.#2021-11-1213:51roman01laIs it possible to resolve a custom EDN tag?#2021-11-1218:22cjsauerQuick question: I can’t seem to get the little intention lightbulb to pop up anymore when hovering over a macro as https://cursive-ide.com/userguide/formatting.html#code-style-settings. I’ve tried disabling most plugins in case of a conflict to no avail :thinking_face: did anything change in this regard?#2021-11-1219:22tony.kayDon't know how to fix that, but one possible workaround is you can use the Action (Help -> Find Action, CMD-SHIFT-A on a Mac I think) search to find the "Resolve as..." action when you're on the name (if that's what you're trying to do).#2021-11-1220:42cjsauerThanks, I think I found the issue. CLJC doesn’t want to show that intention dialog, and even “Resolve as…” doesn’t show up there…#2021-11-1220:42cjsauerCreating a CLJ file and getting access to it from there did the trick.#2021-11-1219:03potetmDoes option+enter work for you?#2021-11-1220:41cjsauerAh, I found the issue. It doesn’t seem to work in CLJC files…`cmd+shift+a` -> “Resolve as…” doesn’t return any hits, and option+enter doesn’t have any effect in cljc files…#2021-11-1220:41cjsauerI had to create a stub CLJ file to get to it.#2021-11-1304:15Oliver GeorgeIs there a place for the "add function spec" equivalent of "command-shift-t"?#2021-11-1405:03cfleminghttps://twitter.com/CursiveIDE/status/1459748271702765570#2021-11-1614:46Shantanu KumarIs it documented anywhere how to specify the Clojure CLI config directory? The fix for https://github.com/cursive-ide/cursive/issues/2212 - I am on 1.12.0-eap2-2021.2#2021-11-1614:56Shantanu KumarFor an already created dps.edn project the "Project Settings > Path to config directory" setting is greyed out. Perhaps it can be defined only for a new deps.edn project?#2021-11-1620:19cflemingDo you have “Use CLI tools” or “Use tools.deps directly” selected?#2021-11-1705:58Shantanu Kumar@cfleming I have "Use tools.deps directly" selected as that's how I am handling the monorepo by setting the common root-level deps.edn (authoritative for all dependencies) path in "Path to user deps.edn".#2021-11-1723:22cflemingHmm, yes, it would make sense to combine those two options, I missed that. I’ll fix that.#2021-11-1723:32cflemingIn the meantime, you should now be able to use the CLI option with the new config field.#2021-11-1413:36mike_ananev@cfleming I can confirm that after an update I see no more Cursive+Idea hangs.#2021-11-1419:34cflemingGreat, thank you! That’s great news. (Not great news that it was frequent enough that you can tell in a day, though…)#2021-11-1422:48kennyIs there some sort of Cursive api function I could call at the REPL that would pop open Cursive's diff viewer? e.g., (cursive/view-diff x1 x2)#2021-11-1501:30cflemingThere isn’t, but I’m planning one.#2021-11-1501:43kennyThat'd be great! What inputs would it take? Just two objects?#2021-11-1504:02cflemingI think so, yes. Anything else that it might need?#2021-11-1519:24kennyThe only other thing I could think would be some sort of identifier to allow updates to an existing diff window. Doesn't seem critical though. #2021-11-1614:46Shantanu KumarIs it documented anywhere how to specify the Clojure CLI config directory? The fix for https://github.com/cursive-ide/cursive/issues/2212 - I am on 1.12.0-eap2-2021.2#2021-11-1515:03helios@cfleming you added support for :as-alias in 1.12.0-eap1, but i still see the alias as "Cannot be resolved" (using latest EAP from yesterday). Is that normal? Do i need to do more?#2021-11-1521:29cflemingOh, sorry - I meant to fix that for the latest EAP but forgot, it’ll be in the next one. The alias should work correctly, but will just be reported as unresolved in the require.#2021-11-1601:16cfleminghttps://github.com/cursive-ide/cursive/issues/2615#2021-11-1519:02Colin P. HillAnyone else have issues where scrolling in the REPL has absolutely massive input lag? I swipe on my touchpad a few times and I have to wait about fifteen seconds for it to stop. Can't quite tell whether this is a Cursive issue, an IntelliJ issue, or something else.#2021-11-1519:07R.A. PorterI've seen it with long-lived REPL sessions with a lot of output. If that's your case, and you don't need the older output in the REPL any longer, you can try clearing it (with the trash button) and it should improve performance.#2021-11-1519:41Colin P. HillHappens even with a fresh REPL#2021-11-2813:00tony.kayLine wrapping. Which you can turn off on the REPLs toolbar. Makes a big performance difference for me.#2021-11-2916:09Colin P. HillAh, I do keep line wrapping on. I'll try disabling it. Shame that it would make such a difference – it's hardly ideal to choose between being able to see everything and being able to scroll through it.#2021-11-1519:53Colin P. HillWhat's the right way to activate the try live template? I select a form and perform the "Surround with live template..." action, and it says no live templates are applicable#2021-11-1603:48stuartrexkingIs there anyway to have css autocomplete working in cljs files? I’m working with fulcro and I’d like css classes to be suggested with working with a :className value in the react components. Can IntelliJ or Cursive do this?#2021-11-1604:01stuartrexkingI see there is an open issue for it https://github.com/cursive-ide/cursive/issues/1553#2021-11-1621:30Wilson VelezHi is someone seeing this error?
Syntax error compiling at (cursive/deps/project.clj:162:62)
I’m clicking over the deps.edn file and trying to “add as a Clojure deps project”#2021-11-1703:27cflemingWhere are you seeing this error? Can you post a screenshot?#2021-11-1712:38Wilson VelezHi @U0567Q30W here is the screenshot#2021-11-1712:39Wilson Velezit happens when clicking this option#2021-11-1723:02cflemingCan you send me your log file, please? Help -> Show Log in Finder/Explorer. Email to <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection> is probably best.#2021-11-1622:06emccueOn the transition to deps.edn. Getting this error running a namespace
class java.lang.Character cannot be cast to class java.lang.String (java.lang.Character and java.lang.String are in module java.base of loader 'bootstrap') No other context. Running via the command line works fine#2021-11-1703:28cflemingAs Alex said:
> can you be more explicit about what “running a namespace” and “running via the command line” mean?#2021-11-1703:28cflemingAlso, do you have anything suspicious in your log file? Feel free to email it over if you’d rather I checked it.#2021-11-1703:43emccue#2021-11-1703:44emccueand running on the command line i do clj -A:dev -M -m company.dev-main#2021-11-1703:45emccueIn the log it just says Error running 'company.dev-main': Error creating run parameters.#2021-11-1703:46emccueunless there is like a log file i should check#2021-11-1622:21Alex Miller (Clojure team)can you be more explicit about what "running a namespace" and "running via the command line" mean?#2021-11-1622:22Alex Miller (Clojure team)oh, sorry I thought this was a CLI question, didn't realize I was in cursive. (but still probably a good question :)#2021-11-1702:52cflemingDefinitely a good question.#2021-11-1709:09simongrayHmmm… I do not seem to be allowed to change the indentation for defonce or other Clojure core forms inline any longer…?#2021-11-1821:15cflemingIs the problem only with those forms, or with all forms? If it’s all forms, what can happen is that the intention gets disabled. Check Editor | Intentions | Clojure.#2021-11-1909:43simongrayI haven’t been consistently able to edit them inline for maybe half a year. Sometimes it’s possible, sometime it isn’t, and I have no idea why it changes. That issue seems to be present with all Clojure core forms, but not other forms. The defonce problem is the fact that it is does not seem to be included in the list of indentation rules in preferences, only cljs.core.defonce is.#2021-11-1909:44simongray(the screenshot is BTW the intentions - none seem to be disabled)#2021-11-1909:49simongrayIt’s now working on my work machine (an Intel Macbook pro), but not working on my ARM Macbook Air. It’s entirely possible that it’s just something weird in my setup.#2021-11-1909:50simongrayI sync settings between different machines a settings repository, so maybe that can screw things up? It does seem a bit wonky sometimes.#2021-11-1709:10simongrayit used to be the case the case that you could right click and configure indentation for Clojure core forms, but that is not possible any longer. Instead, there is a panel in settings where all of the built-in forms are listed (and I guess this is where you’re supposed to change it now), but defonce is not a part of it, only cljs.core.defonce. I guess it was omitted by mistake? It would make sense to just default it to the same indentation behaviour as def (which is what I usually change it to anyway).#2021-11-1716:56cjsauer@simongray that sounds similar to what I was seeing above. Are you by chance editing a cljc file?#2021-11-1716:57cjsauerI had to create a stub clj file, write the form I wanted to manually indent, and then access the inline menu that way.#2021-11-1809:16simongray@cjsauer Nope, regular clj files. It’s been like this for a while. The problem persists on a completely fresh install of macOS.#2021-11-1815:20Ian FernandezHow can I use a boot project with cursive?#2021-11-1815:44salami don't think you can (at least directly) as Cursive doesn't support Boot. #2021-11-1821:15cflemingThat’s correct, I never got around to adding boot support and it’s not used much these days.#2021-11-1912:53Ivar RefsdalWe're doing:
(require 'boot.lein)
(boot.lein/generate)
to generate a project.clj from inside build.boot
and then open the project as leiningen project.#2021-11-1916:25markaddlemanI've been searching for a way to replace the REPL console window with the Portal plugin. I've been playing with repl commands for a few days and have recently come up with :
(ns ~file-namespace)
(try (tap> (eval '~top-level-form))
(catch Throwable t
(tap> t)))
I like it because taps forms that cannot be evaluated.
Anybody else have Cursive repl commands that might be worth sharing?#2021-11-1919:04shinichyHi @cfleming, is there any plan to support paredit-convolute-sexp? I sometimes miss this functionality.
https://github.com/cursive-ide/cursive/issues/809#2021-12-0300:04cflemingSorry, I missed this when you posted it. I could do, but I never found a decent explanation online of how it should work.#2021-12-0504:47shinichyI think emacs’s document explains the behavior.
> “Convolute S-expressions.
> Save the S-expressions preceding point and delete them.
> Splice the S-expressions following point.
> Wrap the enclosing list in a new list prefixed by the saved text.
> With a prefix argument N, move up N lists before wrapping.”
https://github.com/emacsmirror/paredit/blob/8330a41e8188fe18d3fa805bb9aa529f015318e8/paredit.el#L2181
Calva’s implementation
https://github.com/BetterThanTomorrow/calva/blob/986b4fd1afd84a916c6c460acb7a9a69f08e4692/src/cursor-doc/paredit.ts#L879#2021-12-0504:50shinichyAn example used in Calva https://calva.io/paredit/
(let [s [1 2 3 4 5]]
(->> s
(map (apply + [1 2 3]))
|(repeat 4)
(zipmap (range 4))))
;Save the S-expressions preceding point and delete them.
;Saved S-expressions are
;->> s
; (map (apply + [1 2 3]))
(let [s [1 2 3 4 5]]
(|(repeat 4)
(zipmap (range 4))))
;Splice the S-expressions following point.
(let [s [1 2 3 4 5]]
|(repeat 4)
(zipmap (range 4)))
;Wrap the enclosing list in a new list prefixed by the saved text.
(->> s
(map (apply + [1 2 3]))
(let [s [1 2 3 4 5]]
|(repeat 4)
(zipmap (range 4))))
#2021-12-0823:25shinichy@cfleming Just want to ping you in case you missed my reply.#2021-12-0823:56cfleming@U40AQPFAM Thanks, I’ve updated the Github issue with those examples. It’s probably likely to be a low priority with everything else I have to do, though.#2021-12-0900:01shinichy@cfleming ok. Hope you find some time to work on it in the future. Thanks!#2021-11-2017:31eyalchIf anybody was able to make Cursive know about native JavaScript symbols, e.g. .getElementById, I'd love to know how#2021-11-2214:19dvingoThis quite old issue just bit our team, https://github.com/cursive-ide/cursive/issues/1335 Just wanted to "bump" it#2021-11-2217:11AJ JaroI’m getting this error message on a deps.edn project when running -main from the Clojure namespace, specifically with an alias configured.
class java.lang.Character cannot be cast to class java.lang.String (java.lang.Character and java.lang.String are in module java.base of loader 'bootstrap')
However, if I Run with IntelliJ project classpath no error occurs.#2021-11-2221:05AJ Jaro@U0567Q30W I https://github.com/cursive-ide/cursive/issues/2617for this#2021-11-2308:07cflemingThanks for the issue. Does that error appear in your log? Help | Show log in Finder/Explorer.#2021-11-2314:45AJ JaroGreat question @U0567Q30W! It does and I added it to the issue#2021-11-2408:17cfleming@UGMAVSMUM Which version of Cursive are you using?#2021-11-2412:14AJ Jaro@U0567Q30W
Built on: 2021-11-14 17:47
Built from: 1.12.0-eap2-21-gb63530cd#2021-11-2218:56Alex Miller (Clojure team)seems unlikely to have anything to do with deps. can you (pst *e) when it happens and figure out where it's coming from?#2021-11-2220:34AJ Jaro@U064X3EF3 This isn’t run from the REPL. This is run as an IntelliJ Run configuration and the server doesn’t even begin to start before failing with this message in the Event Log.
This most likely has something to do with Cursive and deps.edn#2021-11-2220:46Alex Miller (Clojure team)that's not a message from tools.deps or the CLI so I'd guess cursive#2021-11-2403:20Ian FernandezWhy Run with IntelliJ project classpath and adding a alias that have :jvm-opts ["-Denvironment=test"] does not print this variable when I run (get (System/getProperties) "environment") but when I run with clj -A:my-profile it works well?#2021-11-2407:54cflemingWhen you run with the IntelliJ project classpath, you can’t select an alias. It will use whichever aliases you had selected in the deps toolwindow when you last synced.#2021-11-2407:54cflemingBut those aliases won’t be used to supply things like :jvm-opts#2021-11-2411:03imreIs there any reason jvm-opts are ignored?#2021-11-2414:47Ian FernandezI've selected the aliases on deps toolwindow, Is there any reason jvm-opts are ignored?#2021-11-2419:51cflemingBecause those aliases are only used to sync the project, so they’re only involved in run configurations tangentially. Basically, those aliases determine the deps and source paths that will be synced to the IntelliJ project, and those deps and paths determine the classpath IntelliJ uses. If you do want proper alias support, then the thing to do is to use “Run with deps” and select the aliases there.#2022-10-1910:29imre@U0567Q30W apologies for resurrecting an old thread, but is this decision something you could be open to reconsidering?
The deps tool window is a lot more user-friendly for selecting aliases. Moreover, 'running with deps' is still affected by the Deferred parameters have not been cached! problem reported at https://github.com/cursive-ide/cursive/issues/2308#2022-10-1910:29imreWhenever I hit restart repl on a running with deps repl I get this and it won'r restart#2021-11-2411:46ingesolI have a tools.deps project. I use aliases to override maven style dependencies with :local/root ones to get hot reloading for dependency source code in shadow-cljs. Is there a way in cursive to make code navigation point to dependency source rather than the dependency JAR? So I can cmd-click a function name and go to its definition in the :local/root source?#2021-11-2420:05cflemingDo you have those aliases selected in your deps toolwindow?#2021-11-2420:49ingesolI did not, do now 🙂#2021-11-2420:53ingesolThanks, wasn’t aware of that feature.#2021-11-2417:36favilaUsing 2021.2.3 with 1.12.0-eap2-2021.2, I am unable to send stacktrace reports. (I don’t know whose fault this is :)) The error is Error submitting report: 422 Unprocessable Entity : ErrorResponse(message=Validation Failed, errors=[ErrorItem(resource=Issue, field=labels, code=custom)]) Top of stack:
cursive.exception.GithubException: 422 Unprocessable Entity : ErrorResponse(message=Validation Failed, errors=[ErrorItem(resource=Issue, field=labels, code=custom)])
at cursive.exception.ClojureErrorReportSubmitterKt.update(ClojureErrorReportSubmitter.kt:190)
at cursive.exception.ClojureErrorReportSubmitterKt.access$update(ClojureErrorReportSubmitter.kt:1)
at cursive.exception.ClojureErrorReportSubmitter$submit$1.run(ClojureErrorReportSubmitter.kt:339)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:450)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:117)
#2021-11-2418:48kennyFor me, it doesn't happen for all exceptions. #2021-11-2604:07cflemingDoes this happen for all exceptions for you, @U09R86PA4? It’s a weird error, I’m not sure what the code=custom means and the error is a bit meaningless without that.#2021-11-2604:37favilaIt’s a recent error. I’ll have to wait for another cursive exception to try again#2021-11-2604:38favilaThe original exception I was submitting was related to cursive using a not-yet-ready index, which I’ve seen before and submitted without problems#2021-11-2710:02cfleminghttps://twitter.com/CursiveIDE/status/1464534521315926016#2021-11-2907:14shinichyI created an IntelliJ plugin that enables navigation to Clojure https://github.com/weavejester/integrant component code.
It supports navigation to init-key code from its key in a map. It also supports navigation from #ig/ref to its target. It’s useful when navigating a large code base using Integrant/duct. Please let me know if anyone finds an any issue.
https://plugins.jetbrains.com/plugin/18019-integrant
https://www.youtube.com/watch?v=kuv2f8Afv0o#2021-11-3002:16cflemingThis is really cool! I had a quick look at the code, a few comments:#2021-11-3002:17cflemingI think your FilesSearchScope can just use GlobalSearchScope#filesScope().#2021-11-3002:19cflemingActually, I thought I had another comment, but I think what you have is OK. Nice work! That must have taken some figuring out 🙂#2021-11-3006:44shinichyThanks! It’s my first plugin, so I appreciate your feedback! Yes, it took a lot of time to figure out Psi element tree 😅 It would be great if my plugin depends on only cursive.psi.api.* packages, but I couldn’t find a good way to achieve what I want without cursive.psi.impl.* packages.#2021-11-3006:48shinichyMay I ask a question about testing my plugin? I’m trying to add a test, but ClojureGoToSymbolContributor doesn’t seem to work in the test. Do you know how to enable it in the test?
https://github.com/shinichy/integrant-intellij-plugin/blob/add-test/src/test/kotlin/com/github/shinichy/integrant/IntegrantNavigationProviderTest.kt#L52#2021-11-3009:49cflemingHmm, I don’t, sorry. What I would normally do is get the IntelliJ community source code, and look for other implementations of the base class (ChooseByNameContributor), and see where they’re used in tests. But I just checked a few implementations there and they don’t seem to be used in tests at all, at least not directly. It’s possible there are tests for higher-level things like Go To Symbol which use them under the hood, but I’m not sure, sorry.#2021-11-3021:57shinichyNo worries. Thanks for checking it!#2021-11-2908:32cfleminghttps://twitter.com/CursiveIDE/status/1465236958922227714#2021-11-2909:21heliosUh, JetBrains just announced Fleet, a new lightweight editor. https://www.jetbrains.com/fleet/ Since it's using intelliJ for the code-processing engine I'm curious to see what will come out of it, and if it could be a lightweight alternative for us clojurians (with cursive! 😉). I guess this is news also to you @cfleming?#2021-11-2919:38cflemingIt is news to me! I knew they have been working on various projects along these lines, but I didn’t know they were ready.#2021-11-2922:08cflemingLooks like it will be a while before I can do anything to support this.#2021-11-2915:46Jakub Holý (HolyJak)Is there a way to run all tests from IntelliJ? (Using Lein) I assume that will make the results more navigable than just running lein test in the terminal. I have tried to add a run config. for clojure.test with "run all tests in module" but there was some IntelliJ error about the cursive config class that could not be cast to some II Base class and the run config does not run...#2021-11-2919:39cflemingCould you send the exact error? Or even better, check to see if it appears in your log?#2021-11-3010:52Jakub Holý (HolyJak)I don't know where to find it. It appeared in a pop up window which I killed.#2021-11-3010:58Jakub Holý (HolyJak)Ok, I found II logs but not sure what to look for. I will try to re-create the error.#2021-11-3011:27Jakub Holý (HolyJak)https://github.com/cursive-ide/cursive/issues/2619#2021-11-2917:03Ian FernandezI've tried to get a Repl running clojure from clojure cli with this :jvm-opts :
"--add-modules" "java.base/jdk.internal.misc=ALL-UNNAMED"
#2021-11-2917:04Ian Fernandezit gives me an error:
Unrecognized option: --add-exports
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
#2021-11-3002:21cflemingDoes this happen in Cursive or on the command line?#2021-11-3002:21cflemingOr both?#2021-11-3015:04Ian Fernandezin cursive only#2021-11-3020:12cflemingCan you send a screenshot of the error?#2021-12-0117:11Ian Fernandez#2021-12-0117:12Ian Fernandez#2021-12-0117:12Ian Fernandez@cfleming this should help?#2021-12-0120:59cflemingThat looks to me like your project is using the JDK bundled with IntelliJ, and it doesn’t support that option. There’s more information here about the syntax of that option in different JDK versions: https://stackoverflow.com/questions/40313090/java-9-options-add-exports-vs-xaddexports-not-recognized/40369977#2021-12-0121:01cflemingActually, I misread part of the stacktrace, it’s not using the IntelliJ JVM. But regardless, it’s a problem with the JVM, so I guess your Cursive project is using a different JVM to the one that’s picked up on the command line.#2021-11-2917:04Ian Fernandezwhy this happened?#2021-11-2921:43cap10morganJust updated to 1.12.0 (not sure what I had before but I am on EAP channel) on IDEA 2021.2.3 and lots of (but not all) clojure.core symbols have stopped resolving in a babashka project (e.g. defn, let, and ns don't resolve but def does). I tried invalidating caches and even deleted .idea and the .iml file and re-setup the project but no dice. Anyone else seeing that in babashka projects?#2021-11-2921:48cap10morganOh, this is with babashka 0.6.6#2021-11-2921:52borkdudeHmm, @cfleming - is there anything I can do to help here?#2021-11-2921:53borkdudeI think I found the issue#2021-11-2921:54borkdudethe print-deps result contains a local/root dependency which doesn't make sense for this use case#2021-11-2921:54borkdudeI'll make an issue and fix that#2021-11-2921:59cap10morganThanks @U04V15CAJ!#2021-11-2922:41borkdudeWhat a co-incidence, I had this issue open in my browser and you commented on it just now:
https://github.com/oracle/graal/issues/2666#issuecomment-982087148#2021-11-2922:45borkdudeI pushed a fix for this to master, releasing now#2021-11-2922:46borkdudewill take 15 minutes or so (if CI cooperates)#2021-11-2923:00borkdudedone, 0.6.7 released#2021-11-3000:57cap10morganconfirming 0.6.7 fixed it here too. thanks again @U04V15CAJ!#2021-11-3003:14cfleminghttps://twitter.com/CursiveIDE/status/1465519556999331841#2021-11-3006:48ingesolWhen setting up a Clojure Deps project, we need to manually exclude certain folders like like node_modules , resources/js/compiled , target etc, to remove the noise when searching for namespaces and files. Are there other ways to achieve the exclusion than to manually select the folders in project settings?#2021-12-0111:20ingesolFor reference I found some good help in this issue https://youtrack.jetbrains.com/issue/IDEA-140714#focus=Comments-27-4851651.0-0#2021-11-3016:13Drew VerleeWhat are the steps for working with a shadow cljs project using deps.edn? I assume i
1. start the shadow process via something like npx/npm/yark shadow-cljs watch <some-build>
2. then connect to that repl via cursive run > clojure REPL > remote repl > connection type: nREPL + connection details: connect to server, host: localhost, port <port>.
In step two i'm i supposed to select a "context module"? There isn't any options it just reads [none]#2021-11-3023:04stuartrexkingDo you have a deps.edn module configured?#2021-12-0100:55Drew Verlee@U3FKR3KDF it's setup the same way the cursive docs on deps recommend https://cursive-ide.com/userguide/deps.html#2021-11-3016:16Drew Verleeor maybe i'm supposed to follow the configuring deps docs and then do something more for shadow?#2021-12-0111:20ingesolFor reference I found some good help in this issue https://youtrack.jetbrains.com/issue/IDEA-140714#focus=Comments-27-4851651.0-0#2021-12-0100:56stuartrexkingI don’t do anything special for shadow. I start shadow from the terminal, then I connect to it’s nrepl from intellij run configuration. I choose the module in the connection settings. Once I’m connected, I (shadow/repl :main) or whatever your config is.#2021-12-0100:57stuartrexkingSounds to me like your intellij module isn’t being correctly configured for your deps.edn setup.#2021-12-0100:57stuartrexkingIs there a module in your project settings?#2021-12-0101:00Drew Verleecan you be more specific when you say "a module"?#2021-12-0101:01Drew Verleeor phrase it a different way, i'm not sure exactly what that means.#2021-12-0101:01Drew Verleeand yep, my plan was to start it from my terminal and then connect to it.#2021-12-0101:03Drew VerleeHere is what my run config looks like#2021-12-0101:04Drew Verleeand my settings...#2021-12-0101:04Drew Verlee#2021-12-0101:05Drew VerleeI assume the issue is in my "config" (first pic)#2021-12-0101:06Drew Verleeif i click run i get a "repl run configuration is incorrect - no module selected"#2021-12-0101:07stuartrexking#2021-12-0101:07Drew Verleeshadow-cljs - nREPL server started on port 43885#2021-12-0101:07stuartrexkingIntelliJ Modules#2021-12-0101:07stuartrexkingeach of those is a deps.edn on it’s own.#2021-12-0101:08stuartrexkingWhat do you have in your modules list under Project Structure#2021-12-0101:10Drew Verleelooking. I think i see the issue though, i didn't select the project root maybe.#2021-12-0101:16Drew Verleehere are my modules with the correct project root selected...#2021-12-0101:17Drew Verleeerr#2021-12-0101:17Drew Verlee#2021-12-0101:22stuartrexkingHard to tell your setup from that. Can you screenshot your project structure window?#2021-12-0101:24Drew VerleeWhat does you run/debug configurations look like ? i have "remote repl":
• connection type: nrepl
• connect to server (bc i started shadow locally) w/ host->locahost port->port started for nrepl server by shadow. context module->name of project root.#2021-12-0101:25stuartrexking#2021-12-0101:25Drew VerleeIf i run the "run" then it says its trying to connect to a remote server and just hangs#2021-12-0101:25stuartrexkingHave you started shadow?#2021-12-0101:26Drew Verleeyep#2021-12-0101:26Drew Verleeshadow-cljs - HTTP server available at
shadow-cljs - HTTP server available at
shadow-cljs - server version: 2.15.10 running at
shadow-cljs - nREPL server started on port 43885
shadow-cljs - watching build :dev
[:dev] Configuring build.
[:dev] Compiling ...
[:dev] Build completed. (1512 files, 1 compiled, 0 warnings, 9.10s)
#2021-12-0101:27Drew Verleemaybe its working right now. i think i ran into this before were i expected a repl to pop up after i hit the run button and its like hiding#2021-12-0101:28Drew Verleeyea#2021-12-0101:28Drew Verleelol#2021-12-0101:28Drew Verlee#2021-12-0101:28stuartrexkingGreat#2021-12-0101:28Drew Verleethanks!!!#2021-12-0101:34Drew Verleeit's telling me i can't send cljs forms to a clj repl. Which is fair, but shadow started the nrepl server at the port i selected for my remote repl. And when i started the repl i selected "cljs" though it immeditly changes to clj.#2021-12-0101:38Drew Verleeok i had to run (shadow/repl <my build>)#2021-12-0101:42stuartrexkingyes that’s right#2021-12-0101:44Drew Verleei should be get auto complete on a ns i require into another right e.g re-frame/* with * as my cursor should show everything in the re-frame ns. i don't and they are highlited telling me that that "re-frame" cannot be resolved.#2021-12-0101:44stuartrexkingYeah you should. That’s normally the Module not correctly imported or created.#2021-12-0101:45Drew VerleeIs this module setup by intelliji on load? like why wouldn't it be created correctly?#2021-12-0101:48stuartrexkingImpossible to tell from here.#2021-12-0101:51stuartrexkingOne thing you could do is delete all the .idea and *.iml files and recreate your project.#2021-12-0101:52Drew Verleeill try that.#2021-12-0101:56Drew Verleethat fixed it.#2021-12-0101:56stuartrexkingGreat.#2021-12-0102:01Drew VerleeInteresting. auto completion works, but it's inconstant. Like 1/4 times it won't give them on the same symbol.#2021-12-0102:02Drew Verleebut thats enough diving into this for today 🙂#2021-12-0102:11Drew Verleei swear to god, everytime i try out a different editor then emacs bc something isn't working (auto completion) it scares emacs into working#2021-12-0102:42stuartrexkingThere is no silver bullet unfortunately. Every few months I find myself flirting with a different editor because Cursive doesn’t have exactly what I want, but I always end up returning (happily I might add)#2021-12-0102:44Drew VerleeYep. The autocomplete thing is an utter mystery in this project. From file to file in the same folder it stops working#2021-12-0102:45Drew VerleeWhat i need to do is see if it fails the same way across a couple tools.#2021-12-0102:45Drew VerleeI'm going to find a compiler bug or something. My claim to fame.#2021-12-0102:45Drew Verleefiles with the letter "f" don't work on saturdays when there is a high tide.#2021-12-0103:37cflemingWe can’t send email more than 500 miles: https://www.ibiblio.org/harris/500milemail.html#2021-12-0107:44agigaoHey guys, I wonder why load file to REPL doesn’t eval the content? What is equivalent of cider-eval-buffer in Cursive?#2021-12-0107:48cflemingWhy do you think that load file doesn’t eval the content? It basically does a load-file (with some extra complication).#2021-12-0108:00agigao#2021-12-0108:02agigao:man-shrugging:#2021-12-0108:57cflemingWas your hello command typed into the REPL editor? If so, that’s because the REPL namespace is not the same as the namespace of the file. If you do (test/hello "Cursive") instead, that should work.#2021-12-0111:03agigaoNope, in the ns#2021-12-0120:44cflemingDo you have Preferences | Languages & Frameworks | Clojure | REPL Options | Evaluate forms in REPL namespace selected?#2021-12-0120:45cflemingIf you eval *ns* from the file, what does it show?#2021-12-0207:30agigao1. Yes, it’s marked
2. Loading src/flx/awspricy.clj... loaded and then *ns* => #object[clojure.lang.Namespace 0x52bc6236 "user"]#2021-12-0223:32cflemingOk, that’s the problem. That checkbox is not checked by default. What that means is that if you send forms from an editor to the REPL, they will be evaluated in the current REPL ns rather than the ns of the file from which they came. So, when you load your file it’s loaded into the test ns as you would expect. Then when you evaluate (hello "Cursive") from your file, that happens in the user ns instead of your test ns, which is why hello can’t be found.#2021-12-0309:47agigaoThank you!#2021-12-0112:35scarytomhmm... I seem to be having some issues with deps.edn in cursive today. Has anyone seen a stack trace like this before?
java.lang.RuntimeException: Could not create shim
at cursive.shim.ShimProvider.getShim(Shim.kt:148)
at cursive.shim.ShimProvider.withShim(Shim.kt:115)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:176)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:87)
at cursive.build.BuildSystemProjectDetails.getProjectDetails(BuildSystem.kt:45)
at cursive.build.BuildSystemProjectsManager.reimportAllProjects$lambda-3$lambda-2(BuildSystemManager.kt:149)
at cursive.build.BuildSystemUtil$runTask$1$1.run(BuildSystemUtil.kt:83)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:436)
...
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: Syntax error compiling at (cursive/deps/command.clj:28:40).
at clojure.lang.Compiler.analyze(Compiler.java:6808)
...
at clojure.lang.Var.invoke(Var.java:384)
at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.require(ClojureRuntimeShimImpl.java:73)
at cursive.shim.ShimBootstrap.apply(ShimBootstrap.java:29)
at cursive.shim.Shim.createShimProvider$lambda-1(Shim.kt:80)
at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:155)
at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:153)
at cursive.application.ApplicationKt.onPooledThread$lambda-2(Application.kt:16)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:263)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
... 7 more
Caused by: java.lang.RuntimeException: No such var: deps/make-classpath-map
at clojure.lang.Util.runtimeException(Util.java:221)
at clojure.lang.Compiler.resolveIn(Compiler.java:7388)
at clojure.lang.Compiler.resolve(Compiler.java:7358)
at clojure.lang.Compiler.analyzeSymbol(Compiler.java:7319)
at clojure.lang.Compiler.analyze(Compiler.java:6768)
... 110 more#2021-12-0112:47Alex Miller (Clojure team)Fyi, if you hit the lightning icon and “create a text snippet”, it doesn't spam the channel quite as bad#2021-12-0114:14scarytomThanks @U064X3EF3, I wasn't expecting the stack trace to be so huge when I pasted it in! I'll move it into this thread to avoid the spam in the channel.#2021-12-0114:16scarytomfull stack trace#2021-12-0114:39scarytomI have submitted Exception report #21858 @U0567Q30W#2021-12-0114:41scarytomI've tried re-opening the project against a clean check-out of the code and it now fails as soon as I try to "add as a clojure deps project"#2021-12-0120:37cflemingThanks, I’ll check that.#2021-12-0120:39cfleming@UCQV87CN7 Does upgrading deps fix that? IIRC that was me trying to fix a deprecation warning in deps, and that var might not exist in older versions.#2021-12-0120:41Alex Miller (Clojure team)it is true that it does not exist in (much) older versions#2021-12-0121:18scarytomhmm, it is possible that my clojure cli is a little out of date...
clj --version
Clojure CLI version 1.10.3.855
#2021-12-0121:23scarytomupgraded to 1.10.3.1040 and that seems to have immediately fixed things -- thanks a lot \o/#2021-12-0121:24scarytomI wonder if it is worth getting Cursive to pop up a balloon in IntelliJ warning if the clojure cli version is out of date?#2021-12-0121:25cflemingIt actually does do that, but I made that change without considering that this might be a problem. I’ll figure out what the new minimum version is and update that.#2021-12-0121:26cflemingActually IIRC I feature test rather than having a hard-coded version, can’t remember the details right now but I’ll update after this fix regardless.#2021-12-0121:26scarytomfantastic, thanks.#2021-12-0121:26scarytomlet me know if you need me to harvest any more details for you.#2021-12-0121:26cflemingThanks.#2021-12-0201:26Drew VerleeIs curisve using clojure-lsp at all?#2021-12-0208:58practicalli-johnAs I understand it, cursive static analysis features are based on the years of work that JetBrains put into Intellij static analysis.
clojure-lsp is written from scratch and is used as a core component in Clava for VS Code and can be use with any editors that support the fairly recently published Language Server protocol standard (Emacs, Neovim, etc)
Intellij was built way before that standard came out.
I wonder if JetBraint Fleet editor will support the LSP standard (I assume it will have to support LSP if it's trying to compete with VS Code).
If fleet does support LSP, then in theory cursive could be modified to use that approt, but as fleet hasn't even been properly release yet, there seem a lot of unknowns.#2021-12-0212:32ericdalloThere is a intellij LSP plugin to to use clojure-lsp, but it's not actively maintained AFAIK#2021-12-0219:02tanzoniteblackFleet provides a polyglot experience, offering smart support for many languages and technologies out of the box, with support for even more planned via dedicated plugins. With the help of LSPs you will also be able to use other language services in Fleet.
#2021-12-0219:02tanzoniteblackso we’ll see what happens there, I guess#2021-12-0221:21cflemingCursive doesn’t use LSP at all, no. There are a couple of LSP plugins but I see a lot of complaints about them, and JetBrains have made it clear that they’re not going to support it natively in IntelliJ. Fleet should use it out of the box, though.#2021-12-0205:46thhellerno#2021-12-0221:21favilaI think I found a bug in symbol resolution through an if-let or if-some. In this screenshot, it thinks bug in the “else” branch references the one bound by if-let , but actually it’s from the outer let#2021-12-0221:22cflemingYes, the scope should be restricted to the true arm, but isn’t currently.#2021-12-0221:22favilaActually the identity function calls are not needed, I was just reducing from a more complex case.#2021-12-0221:23favilaah, ok, I haven’t noticed it until now!#2021-12-0221:23favilawild#2021-12-0314:16kennytilton"the scope should be restricted to the true arm"
Really? bug will be falsey in the false arm, but it will still be bound (and in scope). No?#2021-12-0314:18favilaIt will be bound, but by the let in this particular case.#2021-12-0314:19favilaE.g. this is a syntax error:#2021-12-0314:20favila(if-some [bug :foo]
bug
bug)
#2021-12-0314:20favilaSyntax error compiling at (...).
Unable to resolve symbol: bug in this context
#2021-12-0314:20favilabut cursive doesn’t see it#2021-12-0314:21favila#2021-12-0314:21favilaIt thinks the last “bug” is not an error#2021-12-0314:50kennytilton"If test is not nil, evaluates then with binding-form bound to the
value of test..."
That is evil. 🙂#2021-12-0317:54imreWith data visualization tooling like Portal and Reveal getting more and more mature, I seem to be adding more and more repl commands to Cursive. Repl commands are awesome and it would be extremely good to see some QOL updates to the Edit REPL Commands window. I added an issue about the ordering of entries there: https://github.com/cursive-ide/cursive/issues/2622#2021-12-0321:53cflemingThanks, I’ll look at this.#2021-12-0422:07imreThank you, Colin!#2021-12-0318:17salamCursive doesn't balance let bindings with destructuring in them, is this intentional?#2021-12-0319:31imreI actually find this behavior nice#2021-12-0320:18AJ JaroI prefer the balanced let bindings, but this is clearly a preference option that should be available to enforce or not#2021-12-0321:53cflemingYes, this is deliberate since the destructuring forms can be very large (like your example). If you’d like a switch for that I can add one - I tend to try to resist more config options until people complain loudly enough.#2021-12-0322:39salami think it's a valid strategy. 🙂 in this case, i would put the map on a new line anyway. but i'm curious what others think of it...#2021-12-0322:40salami just took a look at our codebase and it appears our team is ok with not balancing destructuring forms in let bindings. all good for now. :-)#2021-12-0807:53Uken7@cfleming Hi,
I would really appreciate very much if there would be an option to balance this kind of let bindings.
Also very often I want to align the pairs in some forms (like test and then statements in a cond or case) because of readability, is this something that others want?
I really like Cursive, great job 👏 Colin.#2021-12-0318:55salam@cfleming better late than never. 🙂
https://github.com/cursive-ide/cursive/issues/2623#2021-12-0321:54cflemingDefinitely better! Thanks, I’ll look at this, I haven’t looked at the new bookmarks stuff in detail yet.#2021-12-0322:42salami'm looking forward to it. 🙂#2021-12-0322:43cflemingI just commented over on the issue with a few thoughts after looking at it briefly.#2021-12-0321:47Colin P. HillWhen using a context action to insert a require, is there any way to get Cursive to insert it in a sort order, rather than just at the bottom?#2021-12-0321:47cflemingI’m actually working on namespace ordering in general at the moment.#2021-12-0512:19AJ JaroIn the meantime, there's an ok plugin to sort requires.
https://plugins.jetbrains.com/plugin/13222-clojure-namespace-sort#2021-12-0409:18p-himikA bit confused as to what's happening.
I'm using an older version of Cursive, 1.10.2-2020.2, and I have the "Clojure Deps" settings section using the CLI tools, version 1.10.3.967.
I just added this alias to my deps.edn:
:test {:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner
{:git/tag "v0.5.0" :git/sha "48c3c67"}}
:main-opts ["-m" "cognitect.test-runner"]
:exec-fn cognitect.test-runner.api/test}
When I run clj -X:test, it works just fine. clj -A:test -Spath works just fine as well and has the correct dependency on the classpath.
However, when I mark the :test alias in the "Clojure Deps" panel in IDEA, I get:
12:12 Errors during project resolution
The following errors were found during project resolve:
/home/p-himik/.../deps.edn:
Library io.github.cognitect-labs/test-runner has missing :sha in coordinate.
If Cursive is using clj CLI tool, how can the above error be explained? How can I fix it?#2021-12-0508:38cfleming@U2FRKM4TW I think you might be being hit by https://github.com/cursive-ide/cursive/issues/2105, which is fixed in 1.10.3. Could you check /usr/local/lib/clojure/libexec and see if you have multiple versions there? If so, please delete all but the one you want and try again.#2021-12-0508:50p-himikSeems like it's something else. The symptoms are different, and even after removing everything but clojure-tools-1.10.3.967.jar and exec.jar and restarting IDEA, the behavior is still the same.#2021-12-0508:51cflemingOk, I’ll see if I can reproduce that tomorrow.#2021-12-0508:53p-himikTrying to poke around with strace right now.#2021-12-0509:05p-himikLove me some bizarre behavior.
After attaching strace, Cursive started erroring out with Could not create shim: Could not create shim.
The stacktrace in the logs:
2021-12-05 11:59:35,974 [ 361182] ERROR - #cursive.build.BuildSystemUtil - Could not create shim
java.lang.RuntimeException: Could not create shim
at cursive.shim.ShimProvider.getShim(Shim.kt:141)
at cursive.shim.ShimProvider.withShim(Shim.kt:108)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:167)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:85)
at cursive.build.BuildSystemProjectDetails.getProjectDetails(BuildSystem.kt:42)
at cursive.build.BuildSystemProjectsManager$reimportAllProjects$$inlined$synchronized$lambda$1.run(BuildSystemManager.kt:150)
at cursive.build.BuildSystemUtil$runTask$1$1.run(BuildSystemUtil.kt:93)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:935)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:442)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:235)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:170)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:629)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:581)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:235)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.NullPointerException
at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.postInvoke(ClojureRuntimeShimImpl.java:49)
at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.init(ClojureRuntimeShimImpl.java:31)
at org.projectodd.shimdandy.ClojureRuntimeShim.newRuntime(ClojureRuntimeShim.java:26)
at cursive.shim.ShimBootstrap.apply(ShimBootstrap.java:26)
at cursive.shim.Shim$createShimProvider$1.apply(Shim.kt:73)
at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:148)
at cursive.shim.ShimProvider$createShim$1.invoke(Shim.kt:90)
at cursive.application.ApplicationKt$sam$java_lang_Runnable$0.run(Application.kt)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:268)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
... 7 more
At the same time, strace shows that one of the IDEA's processes is trying to find libjawt.so but in wrong places for some reason, and fails with SIGSEGV.
Funny thing is, now dependency resolution doesn't work at all - in other projects, after killing strace and restarting IDEA along with purging all indexes. I have no clue how attaching strace could've seemingly prevented IDEA from looking for libjawt.so at the right place.#2021-12-0509:20p-himikAh, I think I know what's going on.
libjawt.so was just a random coincidence.
I see this line in the strace output: stat("/usr/local/lib/clojure/libexec/clojure-tools-1.10.2.796.jar", 0x7f133adf3f40) = -1 ENOENT (No such file or directory)
So for some reason, Cursive is still trying to access an older version of the jar, one that I removed.#2021-12-0514:23p-himik@U0567Q30W Just FYI, got it fixed by removing ~/.clojure/.cpcache.#2021-12-0519:55cflemingThat is super weird. I’m pretty sure that removing .cpcache wouldn’t be the thing that fixed it, since Cursive only calls the CLI script for -Sdescribe, which I don’t think uses it. I’m honestly not sure what might have actually fixed it though. I’m pretty sure that that bug is the underlying cause.#2021-12-0520:17p-himikWell, FWIW that's the only thing I did after which the behavior actually changed - tried multiple IDEA restarts with cache clearing (while using strace at different stages), and all the time strace was showing the old clojure-tools jar being used. Didn't do any other changes myself apart from removing the old jars in the first place.#2021-12-0520:19p-himikAnd BTW if you run clojure -Sdescribe within ~/home/.clojure, that .cpcache directory is definitely used. But only for the stat syscall, so maybe that's not important.#2021-12-0520:44cflemingOhh… actually, I think what you probably had to do was go to the Deps settings, change something, hit apply and then change it back and hit apply again. The path to the jar file that actually gets used is updated during that process.#2021-12-0520:44cfleming(or some similar combination which would provoke IntelliJ to update that value in the Settings dialog).#2021-12-0520:50p-himikOh, you're absolutely right! Not sure how it flew out of my head, sorry for the confusion.#2021-12-0520:51cflemingNo worries, it’s confusing that the process of configuring deps can later provoke this sort of error, for sure…#2021-12-0520:55p-himikFor the sake of my own education - where is this setting stored? I didn't find the old version with grep so I must've missed some place.#2021-12-0521:01cflemingSo in IntelliJ there are project-specific settings and global app-wide ones. This is app-wide, so it’s not stored in the project itself. You can find those directories here: https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#config-directory. On my Mac, the relevant file is at: /Users/colin/Library/Application Support/JetBrains/IntelliJIdea2021.3/settingsRepository/repository/clojure-deps.settings.xml#2021-12-0521:03p-himikOh, I see it now, thanks!#2021-12-0617:02AJ JaroWhen generating stubs in IntelliJ version 2021.3 and Cursive 1.12.1-2021.3 I receive an error in this thread. How can I resolve this?#2021-12-0617:03AJ Jarojava.lang.ExceptionInInitializerError
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at clojure.lang.RT.classForName(RT.java:2211)
at clojure.lang.RT.classForName(RT.java:2220)
at clojure.lang.RT.loadClassForName(RT.java:2239)
at clojure.lang.RT.load(RT.java:449)
at clojure.lang.RT.load(RT.java:424)
at clojure.core$load$fn__6839.invoke(core.clj:6126)
at clojure.core$load.invokeStatic(core.clj:6125)
at clojure.core$load.doInvoke(core.clj:6109)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5908)
at clojure.core$load_one.invoke(core.clj:5903)
at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
at clojure.core$load_lib.invokeStatic(core.clj:5947)
at clojure.core$load_lib.doInvoke(core.clj:5928)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$load_libs.invokeStatic(core.clj:5985)
at clojure.core$load_libs.doInvoke(core.clj:5969)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:667)
at clojure.core$require.invokeStatic(core.clj:6007)
at clojure.core$require.doInvoke(core.clj:6007)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at cursive.stubs.metadata.clojure$read_ns.invokeStatic(clojure.clj:65)
at cursive.stubs.metadata.clojure$read_ns.invoke(clojure.clj:64)
at user$eval259.invokeStatic(create-stub16236083806959255914.clj:2)
at user$eval259.invoke(create-stub16236083806959255914.clj:2)
at clojure.lang.Compiler.eval(Compiler.java:7177)
at clojure.lang.Compiler.load(Compiler.java:7636)
at clojure.lang.Compiler.loadFile(Compiler.java:7574)
at clojure.lang.RT$3.invoke(RT.java:327)
at user$eval5.invokeStatic(form-init9916428172362789119.clj:1)
at user$eval5.invoke(form-init9916428172362789119.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:7177)
at clojure.lang.Compiler.eval(Compiler.java:7167)
at clojure.lang.Compiler.load(Compiler.java:7636)
at clojure.lang.Compiler.loadFile(Compiler.java:7574)
at clojure.main$load_script.invokeStatic(main.clj:475)
at clojure.main$init_opt.invokeStatic(main.clj:477)
at clojure.main$init_opt.invoke(main.clj:477)
at clojure.main$initialize.invokeStatic(main.clj:508)
at clojure.main$null_opt.invokeStatic(main.clj:542)
at clojure.main$null_opt.invoke(main.clj:539)
at clojure.main$main.invokeStatic(main.clj:664)
at clojure.main$main.doInvoke(main.clj:616)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:40)
Caused by: java.lang.ClassNotFoundException: com.amazonaws.services.lambda.AWSLambdaClient
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at clojure.lang.RT.classForName(RT.java:2211)
at clojure.lang.RT.classForName(RT.java:2220)
at amazonica.aws.lambda__init.__init0(Unknown Source)
at amazonica.aws.lambda__init. (Unknown Source)
... 50 more
#2021-12-0620:39cflemingCaused by: java.lang.ClassNotFoundException: com.amazonaws.services.lambda.AWSLambdaClient
#2021-12-0620:40cflemingThat’s the actual problem, any idea why that wouldn’t be on the classpath? I’m assuming that would be pulled in by Amazonica, right?#2021-12-0702:35AJ JaroNo, it’s a bit confusing. Yes, it is pulled in by Amazonica through our deps.edn. Here’s what we have there. Additionally, I have that class available in the External Libraries section of the project.
amazonica/amazonica {:mvn/version "0.3.153"}
com.amazonaws/aws-java-sdk-s3 {:mvn/version "1.11.876" :exclusions [joda-time/joda-time]}#2021-12-0702:36AJ JaroWhen I opened that class I could click Download Source and that seemed to resolve the problem. Is that a deps.edn issue then?#2021-12-0702:55cflemingUm, honestly, I’m not sure. I can’t see how downloading the sources would affect that in any way. Are you able to reproduce the problem or is it now working ok?#2021-12-0722:02AJ JaroI’m not able to reproduce it anymore. It’s a bit odd 🤷#2021-12-0823:42cflemingWell, I think I’m going to file that under “sunspots”.#2021-12-0711:01Jakub Holý (HolyJak)Hi! Is it possible to make Cursive/II report an error when I have an unused alias? I do not see this particular inspection in Prefs - Editor - Inspections - Clojure (there is "unused require" but changing that to Error has on visible effect).
I want to be loudly informed when I have an unused require/alias so that I can fix it before it fails on CI 🙏#2021-12-0715:29indyI guess IntellliJ needs to have a “loudly” inform feature for that. You can click on the problems tab to see the issues. If you’re using IntelliJ to commit your files you could turn on Analyze Code to not allow you to commit unless all the problems are resolved. Or alternatively you could add clj-kondo to your git pre-commit hooks.#2021-12-0808:11Jakub Holý (HolyJak)Thank you!#2021-12-0916:12roman01laHey hey. Anyone using clj-kondo with Cursive? I'm not seeing actual message in a popover when hovering over underlined code. Verified that it doesn't work with both clojure-lsp and kondo-lsp, seems to be an issue with Intellij's LSP plugin#2021-12-0916:24imreI use clj-kondo with the file watcher plugin, it works fine there#2021-12-0916:24roman01lahm, so file watcher, let me try...#2021-12-0916:49roman01la@U08BJGV6E hm, I can see linting report in Intellij's console, but the IDE is not displaying those in the editor for me#2021-12-0916:49roman01ladid you do anything besides setup guide in kondo's repo?#2021-12-0919:38imreno I didn't. here's my related config#2021-12-1423:26zxspectrrslightly off topic but is there a way to make the red error squiggles a bit more visible?#2021-12-1423:26zxspectrris that a styling setting in intellij somewhere?#2021-12-0921:43d5pwith latest cursive+intellij , when i cmd+up in repl to move between history i get an error and this stacktrace , is this known or anything i can do to sort it out?#2021-12-0921:45cflemingSorry, this is a known issue: https://github.com/cursive-ide/cursive/issues/2620#2021-12-0922:07d5pahh all good, thanks will wait for the next release#2021-12-0921:49Alex Miller (Clojure team)is there any way to use the intellij bytecode viewer with a Clojure class instance during debug?#2021-12-0921:51cflemingHmm, I’m not sure. If you’re AOT compiling you can find the class in the project view and open it, but I can’t think of a way to view a dynamically loaded one.#2021-12-0921:53Alex Miller (Clojure team)I cannot say how incredibly useful that would be to me :)#2021-12-0921:53cflemingI’ll see what I can do 🙂#2021-12-0921:58cfleminghttps://youtrack.jetbrains.com/issue/IDEA-83442 looks like your issue.#2021-12-1416:06GGfpcJust came across this post on HN: https://tonsky.me/blog/sublime-clojure/
The inline eval and exception formatting is really great. Would love it if they made it across to Cursive eventually#2021-12-1420:55cflemingYes, inline eval is something I’m working on. I’d be interested to see what it does with large data structures, I’ll have to install it and see.#2021-12-1421:03cflemingCursive does already also do the exception formatting, although it doesn’t yet work for #error{} objects for boring reasons.#2021-12-1507:20Erik ThorseliusAnyone seen errors like this? I'm a bit unsure where it originates from. Is it intellj/cursive, nrepl or something in my code?#2021-12-1507:22cflemingThis is a Cursive thing, which might be a problem in your code, or it might be a bug in Cursive. I have an outstanding issue to provide better debug logging around this: https://github.com/cursive-ide/cursive/issues/2612.#2021-12-1507:23cflemingIn the meantime, if you try the steps here: https://github.com/cursive-ide/cursive/issues/1432#issuecomment-538613756, do you see anything useful?#2021-12-1507:24Erik ThorseliusGreat! Thanks, I will read#2021-12-1507:28Erik ThorseliusNo output when I try to load file in repl 😞
2021-12-15 08:26:17,626 [2028144] INFO - lij.diagnostic.DebugLogManager - Set DEBUG for the following categories: #cursive.repl.actions
2021-12-15 08:27:35,985 [2106503] INFO - il.indexing.FileBasedIndexImpl - Health check heartbeat
#2021-12-1507:29cflemingWhen do you see that error?#2021-12-1507:29cflemingIs it as the result of some action?#2021-12-1507:30Erik ThorseliusYes, when I run Load files in REPL it shows up where I have my cursor#2021-12-1507:36cflemingSo, that should output something in the log. One sec…#2021-12-1507:37cflemingJust to check, this is “Load file in REPL” or “Sync files in REPL”?#2021-12-1507:37Erik Thorselius"Load file in REPL"#2021-12-1507:38Erik ThorseliusSync gives the same error#2021-12-1507:38cflemingActually, could you add #cursive.namespace to the debug log settings as well, and try again?#2021-12-1507:40Erik Thorselius2021-12-15 08:39:27,655 [2818173] DEBUG - #cursive.namespace - Dependency cycle .../js/out/re_frame/trace.cljc -> ...static/js/compiled/out/re_frame/trace.cljc -> .../resources/public/js/out/re_frame/trace.cljc
#2021-12-1507:40Erik ThorseliusOkey, here is something to work on. Maybe more on my side then#2021-12-1507:41cflemingOk, it looks like you don’t have your CLJS output directories excluded. If you do that, does it help?#2021-12-1507:42Erik ThorseliusIs it configured in my deps.edn file?#2021-12-1507:42cflemingNo, you’ll probably have to do that manually, sorry. How are you compiling your CLJS?#2021-12-1507:43Erik ThorseliusGood question, this is not my strong side. Could figwheel help me with this?#2021-12-1507:47cflemingFigwheel is one way to compile your CLJS, yes, Shadow-CLJS is another, and you can also compile using just the straight CLJS compiler. I’m not sure how you’re doing it in your case, however. Can you find the directories mentioned in the error message? js/out, static/js/compiled/out and resources/public/js/out?#2021-12-1507:47cflemingIt actually looks to me like you’re getting some CLJC files in places where you should only have JS output, though, which is something you’ll have to fix in your build.#2021-12-1507:49cflemingIf you can find those directories, you probably want to exclude them, which means you right click them in the project view and select “Mark Directory As | Excluded”. However you’ll probably want to do that higher up in your directory hierarchy since you probably don’t want IntelliJ indexing any of your output.#2021-12-1507:51Erik ThorseliusExcluded the folder and everything works as expected. Thanks a lot!#2021-12-1514:15Colin P. HillTrying to run all tests in a project with Leiningen, I'm getting this error:
java.lang.ClassCastException: class cursive.runner.ClojureTestConfiguration$getRunProfileState$state$1 cannot be cast to class com.intellij.execution.configurations.RunConfigurationBase
IDEA Ultimate 2021.2.3, Cursive 1.12.1-2021.2. Is this a known issue?#2021-12-1519:54cflemingThis is a bug sorry, it’s fixed for the next build: https://github.com/cursive-ide/cursive/issues/2621#2021-12-1521:09Colin P. HillSo, let's suppose I keep encountering a bug where my REPL editor gets stuck in read-only mode, but I can't figure out the conditions for reproducing it. Is there any diagnostic information I could give to make that bug report possibly actionable, or should I hold off until I can figure out exactly when it's happening?#2021-12-1600:10cflemingHmm, I’m not sure. So what is going on? You suddenly can’t type in the REPL editor?#2021-12-1612:45Colin P. HillWhen you're starting up a REPL, it doesn't let you type in the editor until it finished initializing, right? I'm running into a problem where it just never releases that hold. Typing in the editor just results in a little speech bubble that says (something like; I don't have it happening now to get the exact wording) "This view is read-only". Amusingly, I can type parens, but I can't delete them or type anything else, which, come to think of it, is probably a distinct but much less problematic bug.#2021-12-1623:58cflemingI see, so it’s not like it suddenly breaks, but that the REPL never accepts any input? That’s probably something as a result of the fix to stop the REPL focusing at startup, I’ll look at that. Does this happen sporadically for the same REPL run config, or are there particular configs that it always happens for and some that it doesn’t?#2021-12-1712:54Colin P. HillCorrect, the REPL simply never becomes usable. It happens sporadically for the same config. Yesterday I had to relaunch the same REPL something like five times before I could get a usable one. It feels like a state thing, but I haven't figured out exactly what ceremony will get it to work. A few slightly uncommon things about my environment that might be culprits:
• The project uses multiple Leiningen profiles to build distinct artifacts with distinct source paths. These profiles clobber each other with ^:replace directives. In order to get it to work with Cursive, I have it configured to use a custom profile that lists all the source paths, but the REPL configurations use the project's native profiles.
• As a consequence of the above, I keep two REPLs running much of the time, one for each of the two major profiles in the project.#2022-02-0814:27Colin P. Hill@U0567Q30W I think I figured this out! The REPL startup for my project is so slow that I was hitting the timeout configured in the plugin. I would get an error message saying something like "No connection details received" – but the startup would keep trucking along, and eventually a message would be printed that the REPL was started on port suchandsuch. I was ignoring the error message because it was mingled in with the unfortunately large number of spurious warnings I get on startup, and never suspected that the message might be coming from Cursive itself. So I think this is mostly working as intended, but the message could probably stand to be more prominent and clear, maybe pointing the user to the timeout setting.#2021-12-1600:09cflemingSomething I’ve been meaning to add for ages: the ability to diff data structures from the REPL.#2021-12-1600:24kennyThis will be a huge win!!#2021-12-1600:28cflemingI hope so! I’m not sure yet how it will perform for really big structures (the return value has to contain both sides of the diff, and the UI might be interesting too).#2021-12-1600:29kennyIt'd perform equivalently to how it performs in the clojure.test integration, I'd assume?#2021-12-1600:30cflemingRight, but I suspect people will use this with larger results.#2021-12-1600:31kennyAh. Probably right. Maybe generate some large data with test.check and see what happens 😅#2021-12-1600:32cflemingYep. I can probably create an option to elide identical values in maps and replace them with ... or something too.#2021-12-1600:34kennyOoo. That'd be awesome and useful even for the test integration!#2021-12-1600:36kennyOne thing that's always been really tough to parse out is when a set of maps differs from the left and right sides. The diff UI seems really tricky and perhaps some assumptions had to be made. I could find an example if interested. #2021-12-1600:36cflemingYes, I’d definitely be interested in an example.#2021-12-1600:37cflemingIt’s definitely hard to know how to present arbitrary diffs, since it’s impossible to know how arbitrary data structures should be formatted.#2021-12-1600:39kennyYeah. I have no idea how you'd even present the diff for a set of maps in the correct manner, now that I think about it. You don't know the semantics of the things I want compared since they're in a set.#2021-12-1600:40cflemingRight, and it’s often obvious to the user how you would want that data formatted, but that can’t be determined automatically. If you have suggestions about how it might work I’m all ears.#2021-12-1600:41cflemingI’ve thought about showing the diffs as a collapsible tree, but haven’t got around to a proof of concept for that.#2021-12-1600:49kennySent a follow up with a difficult map+set diff via DM. I don't have any ideas on that one since it seems very hard to do for arbitrary data.#2021-12-1600:51kennyHere's one I've gotten used to at this point: list vs vector show up in the diff even though they will be treated as =.#2021-12-1600:52cfleming(= '(1 2 3) [1 2 3])
=> true
WAT#2021-12-1600:52cflemingI’m truly shocked by that.#2021-12-1600:53cflemingThose things are not equal by anyone’s definition.#2021-12-1600:55kennyHaha. It has some weird consequences too. It does happen to be useful in tests a lot since the vector literal is nicer to type than (list ...). Fun thread on the topic: https://clojurians.slack.com/archives/C03S1KBA2/p1621184012406400#2021-12-1600:59kennyMaybe you've seen this already, but here's another interesting approach: https://fazzone.github.io/autochrome.html#2021-12-1601:44cflemingYep, there are a bunch of them - deep-diff2, editscript and a couple more.#2021-12-1601:54kennyOne other thing I was curious about. If a test reports :expected and :actual keys and is not an is form, could the diff still be shown? #2021-12-1602:11cflemingUmm… maybe? I’d have to go back and refresh my memory of how clojure.test works. What’s your use case?#2021-12-1602:19kennySupport for match? https://github.com/nubank/matcher-combinators/blob/551b6f5e915d523027cb4f26ecfe3c5423ac859f/src/clj/matcher_combinators/clj_test.clj#L38
Right now I have to manually run the test to view results. #2021-12-1602:20kennyFrom a naive perspective, it seems reasonable that any test report that contains an expected and actual could render the diff viewer. #2021-12-1602:22cflemingSeems reasonable, I’ll take a look.#2021-12-1602:25kennyAnyway, thanks for working on the diff api function. That will be really helpful.#2021-12-1614:51imreThis is a really promising feature, thanks Colin!#2021-12-1606:09agigaoHey there, I wonder how Cursive "decides" which profile to use and load? For example I have dev,test under profiles in repl configuration. Both configurations have corresponding config dirs: config/test/ and config/dev/ populated with config.edn . Repl starts by having both dirs in a classpath. And when I run test in the repl, which loads fixture from the same dir, where we load config file using https://github.com/yogthos/config, :java-class-path has config/test. By contrast, when dealing with Emacs, I have to manually specify the test profile. And I wonder how does Cursive choose a proper profile and/or config dir for :java-class-path?
Not completely sure if it's the right place and the sound question, though 👻#2021-12-1608:28cflemingSo there are two places where you can configure profiles, and they do different things. There’s this: https://cursive-ide.com/userguide/leiningen.html#working-with-profiles, which is used when syncing the project to the IDE. And then you can also select the profiles to be used when constructing the classpath in your REPL run configuration, and that will be used to start the REPL (or other task). Does that make sense?#2021-12-1608:29cflemingIt sounds like you’re talking about running a REPL, so it’s probably the second of those. You can find the selected profiles in the run config.#2021-12-1610:42Daniel StephensHi all, wonder if anyone could help me sort this issue with test output when an exception is thrown or confirm if it's a cursive bug?
Basically if somethig inside of (is) throws an exception, then I only get the top level Exception when running with cursive's 'run test' fns.
If it's not in an (is) it works fine so my guess was that cursive overrides the report :error multimethod and drops the cause, but I'm not sure.
Attached shows:
• what I get running with other test runners, showing both the top level and causing parts of the exception.
• what I get running with cursive REPL -> run test fns which only shows top level
• and the test that I used for recreation purposes#2021-12-1713:32Fudge#cursive#2021-12-1713:49souenzzowhen we do #_ before a ^metadata, cursive highlights as if just the metadata is ignored. But the form will be ignored too.#2021-12-1722:14cflemingOops.#2021-12-1715:34sbIf I use remote repl connection (nrepl) configuration, that is much-much faster (init phase/ mount lib) than when I start as local “Run with Leiningen”. Is that normal? or do I need to add extra params?#2021-12-1805:36cflemingDo you mean the REPL startup? That’s because if you use a remote connection, it’s connecting to a server which is already started, so that doesn’t include any of the startup time before the REPL is ready.#2021-12-1716:14macrobartfastUsing cursive for a bit in Intellij… is there a way to get C-c C-c and C-c C-e to work like in Emacs (for sending form under point and before point to REPL, respectively)?#2021-12-1716:19R.A. PorterI can't answer that precise question, but IJ itself has a set of emacs keybindings that you could switch to. If you did, it'd probably make your overall editor experience feel a bit more familiar; likewise, it would also probably change many of the Cursive-specific bindings.#2021-12-1716:20macrobartfastThank you for replying! I did try the Emacs bindings… it didn’t seem to enable C-c C-c, for instance (which is my usual way of evaluating the form under the point).#2021-12-1716:20macrobartfastSo still thrashing a bit. 🙂#2021-12-1716:21Colin P. HillYou should be able to add whatever binding you want for whatever command you want. IntelliJ supports two-stroke sequences, so C-c C-c and C-c C-e should both be doable.#2021-12-1716:47Daniel Stephens@macrobartfast As Colin mentions, I think equivalent behaviours are implemented by cursive so you can setup shortcuts as you wish for them#2021-12-1716:22ikitommi@macrobartfast you should use something like integrant and call (reset) to reload everything. It’s in order of milliseconds#2021-12-1716:23macrobartfast@ikitommi gotcha! just about to set up integrant, so that’s perfect.#2021-12-1716:24macrobartfast(I accidentally deleted the message here that @ikitommi was responding to, which was how to reload an app as quickly as possible)#2021-12-1717:58souenzzomy cursive always loses its "ignore directory" configuration and stuck trying to index .shadow-cljs and cljs-generated files 😞
I need to wait until the index finish to edit this configuration and make it ignore the dirs#2021-12-1805:34cflemingWhen you say it always loses it, do you mean that it gets overwritten on a project sync? If you mark your directory then go to the lein or deps toolwindow and hit refresh, does it lose it then?#2021-12-2012:24souenzzoHello
This morning I removed all my project files, did a clean git clone (we do not commit any of node_modules or .shadow-cljs files)
Also, removed all my intellij plugins, removed .cache and .local/share/JetBrains directiries
So I did a "fresh start" of the intellij with my project
still, i couldn't open the project
I was using this project with cursive/intellij for ~6 months now, without any problems
There is others developers, with linux/mac in this project too, all them with intellij/cursive
It stuck in Synchronizing Clojure Deps project with the messae Reading projects\n Reading appstream-model
The project is a "monorepo", where there is a projects folder with ~20 clojure projects, all them with a deps.edn, many of them using git and local/root
Here my logs
https://gist.github.com/souenzzo/cc097812768a4e7e0504a9ea36c8d134#2021-12-2017:08souenzzostuck again in Synchronizing Clojure Deps project
How can I debug why it stuck in Synchronizing Clojure Deps project ?#2021-12-2017:08souenzzothere is no CPU activity#2021-12-2017:11souenzzoif I click in x button, it stuck in Stopping - Synchronizin Clojure D...#2021-12-2017:11souenzzothis is really annoying#2021-12-2105:40cflemingUgh, sorry, that does sound painful. Can you get a thread dump of the IDE when it’s stuck synchronising to see where it’s blocked?#2021-12-2105:41cfleminghttps://intellij-support.jetbrains.com/hc/en-us/articles/206544899-Getting-a-thread-dump-when-IDE-hangs-and-doesn-t-respond#2021-12-2115:27souenzzohttps://gist.github.com/souenzzo/cc097812768a4e7e0504a9ea36c8d134#file-threaddump-java#2021-12-2115:33souenzzoit is nice that I can get the intellij threaddump from intellij profile tab
https://gist.github.com/souenzzo/cc097812768a4e7e0504a9ea36c8d134#file-switch-to-clojure-cli-java#2021-12-2115:35souenzzoi switched from tools.deps directly to tools.deps CLI, the WAITING stacktrace chagend, but seems to be the same issue.
Which clojure cli command do cursive execute? I can run it directly?#2021-12-2115:40souenzzoI downgraded tools.deps directly 0.11.935 and now it is working again.
Recap:
• my cli version is 1.10.3.1020. it stuck. stacktrace in the git
• using tools.deps 0.12.x directly stuck. stracktrace in the git
• using tools.deps 0.11.x works
If you want a complete thread dump, or if you want me to do some other debug thing to understand better my issue, I'm open to do it.#2021-12-2205:39cflemingOh, thanks, it might be an issue with new t.d.a versions, I’ll try to repro.#2021-12-1718:29FudgeI'm unable to download JDK 8 in my macbook, any suggestions on how I can download JDK 8?#2021-12-1718:38R.A. Porterhttps://adoptium.net/
and if you use brew you should be able to tap this cask: https://formulae.brew.sh/cask/temurin#2021-12-1718:38R.A. Porter(Adoptium used to be AdoptOpenJDK)#2021-12-1721:34Lennart Buitare you perhaps on an M1 mac?#2021-12-1805:26cflemingI find it easiest to use IntelliJ to do this. Open any project, then File->Project Structure. Select SDKs in the list on the left, and press +. Select “Download JDK” then you can choose your distribution, architecture and version easily.#2021-12-1817:12Romit GandhiI have generated re-frame project but in the intellige+cursive it is not detecting it and I'm not able to use any plugin features, do I need to do something extra?#2021-12-2208:24cflemingI’m going to need more information about what you’re doing, and what is not working. Did you follow either https://cursive-ide.com/userguide/leiningen.html or https://cursive-ide.com/userguide/deps.html to import your project?#2022-01-0417:15Romit GandhiActually @U0567Q30W, I generated re-frame project using lein new re-frame <app-name> and in that there is neither project.clj or deps.edn . Actually, inside that shadow-cljs.edn is there. And when I'm loading that project in Intellige using cursive it is not able to provide me any suggestion or any plugin related features.
Can you please help me regarding that ?#2022-01-0420:13cflemingThe shadow docs discuss how to work with Cursive: https://shadow-cljs.github.io/docs/UsersGuide.html#_cursivehttps://shadow-cljs.github.io/docs/UsersGuide.html#_cursive#2021-12-1820:34FudgeHow do I add cursive plugin zip file in intellij?#2021-12-2000:22cflemingAre you just trying to install Cursive, or do you need to install from disk for some reason?#2021-12-2000:23cflemingIf you just need to install, then follow this: https://cursive-ide.com/userguide/#installing-cursive. If you need to install from disk for some reason, do something like this: https://cursive-ide.com/userguide/#downgrading-cursive#2021-12-1822:50Mikehey i'm having some trouble configuring cursive on windows. i'd like to use CLI Tools and installed clojure with the clj on Windows ps script, but it can't find the clojure command.#2021-12-1901:17cflemingThe best way to use deps with Cursive on Windows is to use tools.deps directly, see: https://cursive-ide.com/userguide/deps.html#windows.#2021-12-1901:18cflemingCursive can’t use WSL yet, unfortunately. I believe there’s support for graphical apps coming to WSL sometime, and then it should be possible to run IntelliJ entirely inside it, but AFAIK that’s not possible yet. I don’t use Windows myself though, so I’m not very up to date.#2021-12-1823:21Mikeis there a way to use wsl?#2021-12-2107:04agigaoI'd suggest - https://github.com/microsoft/wslg#2021-12-1823:21Mikewith cli tools#2021-12-2109:01SKhi! how to work around https://github.com/cursive-ide/cursive/issues/2620 ?#2021-12-2109:02SKwould it be possible to push version 1.11.0 (the last version without this bug) which is compatible with intellij 2021.3 so anyone can downgrade to that if needed? unfortunately I've upgraded intellij to 2021.3 and now I cannot downgrade the plugin because there is no such combination of versions here: https://plugins.jetbrains.com/plugin/8090-cursive/versions/stable. Reverting the whole intelliJ install, including all settings and plugins is a pain..#2021-12-2110:50Ilan Uzananyone else is using Intellij on Windows and has a problem with one of the leiningen projects (not on WSL), that whenever I run the REPL Intellij just gets stuck on "Calculating classpath" forever?
If so, how did you solve it?
I am working on Windows 10, Intellij Community edition 2021.3, Cursive 1.12.1#2021-12-2110:51Ilan UzanI see someone described a similar issue https://clojurians-log.clojureverse.org/cursive/2021-10-03, only in deps project - but it doesn't say if and how he solved it.#2021-12-2206:49shinichyHas anyone had this annoying Slow operations are prohibited on EDT issue?
https://github.com/cursive-ide/cursive/issues/2628#2021-12-2208:14cflemingYes, a lot of these are showing up in Cursive, as well as in other plugins. I’m gradually working through the ones I’ve seen, and the ones that have come through in the tracker.#2021-12-2221:38shinichyGood to hear that. Thanks!#2021-12-2212:40scarytomI regularly get exceptions from Cursive, and I'm pretty religious about hitting the "Report to Cursive" button. Recently I've started getting an exception that fails to report! I'll include the stack trace for the exception and the message I get when I try to report it on the thread under this post. Just an FYI really @cfleming, as I don't know how else to report this. Not really blocking me.#2021-12-2212:40scarytomupdate failed for AnAction(com.intellij.codeInsight.documentation.actions.ShowQuickDocInfoAction, id=QuickJavaDoc) with text=Quick Documentation
com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
at com.intellij.openapi.project.IndexNotReadyException.create(IndexNotReadyException.java:67)
at com.intellij.util.indexing.FileBasedIndexImpl.handleDumbMode(FileBasedIndexImpl.java:852)
at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:804)
at com.intellij.util.indexing.FileBasedIndexEx.processExceptions(FileBasedIndexEx.java:244)
at com.intellij.util.indexing.FileBasedIndexEx.processValueIterator(FileBasedIndexEx.java:349)
at com.intellij.util.indexing.FileBasedIndexEx.processValuesInOneFile(FileBasedIndexEx.java:281)
at com.intellij.util.indexing.FileBasedIndexEx.processValues(FileBasedIndexEx.java:222)
at com.intellij.util.indexing.FileBasedIndexEx.processValues(FileBasedIndexEx.java:211)
at cursive.index$class_by_text_offset.invokeStatic(index.clj:574)
at cursive.index$class_by_text_offset.invoke(index.clj:571)
at cursive.intellij.class$class_by_text_offset.invokeStatic(class.clj:280)
at cursive.intellij.class$class_by_text_offset.invoke(class.clj:279)
at cursive.intellij.class$find_class$fn__9817.invoke(class.clj:292)
at clojure.core$some.invokeStatic(core.clj:2705)
at clojure.core$some.invoke(core.clj:2696)
at cursive.intellij.class$find_class.invokeStatic(class.clj:292)
at cursive.intellij.class$find_class.invoke(class.clj:284)
at clojure.lang.Var.invoke(Var.java:384)
at cursive.api.DelayedFn.invoke(DelayedFn.java:31)
at cursive.findUsages.declarations.ClassDeclarationSearcher.findDeclarationsAt(ClassDeclarationSearcher.java:31)
at com.intellij.model.psi.impl.DefaultPsiSymbolDeclarationProvider.getDeclarations(DefaultPsiSymbolDeclarationProvider.kt:18)
at com.intellij.model.psi.impl.Declarations.declarationsInElement(declarations.kt:54)
at com.intellij.model.psi.impl.Declarations.allDeclarationsAround(declarations.kt:23)
at com.intellij.model.psi.impl.TargetsKt.declarationsOrReferences(targets.kt:120)
at com.intellij.model.psi.impl.TargetsKt.declaredReferencedData(targets.kt:41)
at com.intellij.model.psi.impl.TargetsKt.targetSymbols(targets.kt:23)
at com.intellij.lang.documentation.symbol.impl.ImplKt.symbolDocumentationTargets(impl.kt:13)
at com.intellij.lang.documentation.ide.impl.IdeDocumentationTargetProviderImpl.documentationTargets(IdeDocumentationTargetProviderImpl.kt:36)
at com.intellij.lang.documentation.ide.actions.ActionsKt.targetsFromEditor(actions.kt:96)
at com.intellij.lang.documentation.ide.actions.ActionsKt.documentationTargets(actions.kt:64)
at com.intellij.codeInsight.documentation.actions.ShowQuickDocInfoAction.update(ShowQuickDocInfoAction.kt:32)
at com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performDumbAwareUpdate$0(ActionUtil.java:131)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareUpdate(ActionUtil.java:145)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.doUpdate(ActionUpdater.java:602)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$updateActionReal$7(ActionUpdater.java:126)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.callAction(ActionUpdater.java:170)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.updateActionReal(ActionUpdater.java:127)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$new$0(ActionUpdater.java:109)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.update(ActionUpdater.java:588)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:434)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$21(ActionUpdater.java:413)
at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1454)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:413)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandGroupChild(ActionUpdater.java:489)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$doExpandActionGroup$21(ActionUpdater.java:413)
at com.intellij.util.containers.ContainerUtil.concat(ContainerUtil.java:1454)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.doExpandActionGroup(ActionUpdater.java:413)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.expandActionGroup(ActionUpdater.java:233)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupAsync$13(ActionUpdater.java:286)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupAsync$15(ActionUpdater.java:309)
at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1084)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupAsync$16(ActionUpdater.java:309)
at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runActionAndCancelBeforeWrite(ProgressIndicatorUtils.java:158)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupAsync$17(ActionUpdater.java:305)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:277)
at com.intellij.openapi.actionSystem.impl.ActionUpdater.lambda$expandActionGroupAsync$18(ActionUpdater.java:304)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:246)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:32)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:225)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:213)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:214)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
#2021-12-2212:41scarytomFailed to submit exception report: 422 Unprocessable Entity : ErrorResponse(message=Validation Failed, errors=[ErrorItem(resource=Issue, field=labels, code=custom)])#2021-12-2213:33SKYou could also search the github issue tracker and if the issue is not there, add a new bug ticket#2021-12-2214:44imreI also got the failed to submit error a number of times now#2021-12-2222:50cflemingThanks, a few people have reported this here but I’ve not seen one of these yet. Unfortunately the GH error message is not very useful, I have no idea what the code=custom bit means. I’ll dig around a bit and see if I can find anything.#2021-12-2310:25cfleminghttps://twitter.com/CursiveIDE/status/1473962706294116354#2021-12-2310:39steveb8nThat diff tool will be super useful. Xmas bonus#2021-12-2311:18Lennart Buit(Not so serious) Are bugs ever non-annoying?#2021-12-2319:44cfleming@UDF11HLKC Some are much more annoying than others.#2022-12-2715:00zxspectrrhi colin, sorry if I've missed this, but I don't understand how to use the diff.
I read through the post in google groups and when I run this
(cursive/diff (meta #'defn) (meta #'let) :title "Metadata")
I just get `no such namespace: cursive'#2022-12-2715:00zxspectrri'm guessing i need to require something, i'm jiust not sure what#2022-12-2720:41cfleming@U027433844C How did you start your repl?#2022-12-2721:28zxspectrrvia intellij#2022-12-2721:28zxspectrrjust created a local lein repl#2022-12-2721:29zxspectrras in i host from within cursive rather than connecting into an existing socket repl#2022-12-2721:30zxspectrr#2022-12-2722:38cflemingAnd it’s just a Clojure REPL, you’re not booting into a CLJS one or anything like that?#2022-12-2722:40cflemingIn the meantime, you can use the tagged-literal workaround described in the email. The diff function is literally just:
(defn diff [left right & {:keys [title]}]
(tagged-literal 'cursive/diff (cond-> {:left left :right right}
title (assoc :title title))))#2022-12-2722:57zxspectrrjust a normal clj repl yea#2022-12-2722:57zxspectrroh i didn't get the email#2022-12-2800:51cflemingNo, I mean in the Google Groups post - if you’re on the mailing list you get that as an email.#2022-12-2801:58zxspectrroh i see#2021-12-2322:11salamColin, were you able to get to the bottom of why one would get this error from Cursive when working with a remote socket REPL?#2021-12-2322:12salam2021-12-23 14:13:06,137 [20995681] ERROR - #cursive.repl.socket-repl - Exception 'java.lang.Throwable: Error handling REPL response
java.lang.IllegalArgumentException: No implementation of method: :out of protocol: #'cursive.repl/Handler found for class: nil
at clojure.core$_cache_protocol_fn.invokeStatic (core_deftype.clj:584)
clojure.core$_cache_protocol_fn.invoke (core_deftype.clj:576)
cursive.repl$fn__1555$G__1527__1564.invoke (repl.clj:91)
cursive.repl.socket_repl$handler.invokeStatic (socket_repl.clj:62)
cursive.repl.socket_repl$handler.invoke (socket_repl.clj:46)
cursive.repl.socket_repl$read_loop$fn__4218$fn__4219.invoke (socket_repl.clj:113)
cursive.repl.socket_repl$read_loop$fn__4218.invoke (socket_repl.clj:110)
cursive.repl.socket_repl$read_loop.invokeStatic (socket_repl.clj:103)
cursive.repl.socket_repl$read_loop.invoke (socket_repl.clj:70)
cursive.repl.socket_repl$start_session$reify__4245.run (socket_repl.clj:181)
com.intellij.openapi.application.impl.ApplicationImpl$1.run (ApplicationImpl.java:263)
java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
java.util.concurrent.FutureTask.run (FutureTask.java:264)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run (Executors.java:668)
java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run (Executors.java:665)
java.security.AccessController.doPrivileged (AccessController.java:-2)
java.util.concurrent.Executors$PrivilegedThreadFactory$1.run (Executors.java:665)
java.lang.Thread.run (Thread.java:829)
' was reported 6220 times
2021-12-23 14:14:05,916 [21055460] ERROR - #cursive.repl - Exception 'java.lang.Throwable: Error handling response
java.lang.IllegalArgumentException: No implementation of method: :out of protocol: #'cursive.repl/Handler found for class: nil
at clojure.core$_cache_protocol_fn.invokeStatic (core_deftype.clj:584)
clojure.core$_cache_protocol_fn.invoke (core_deftype.clj:576)
cursive.repl$fn__1555$G__1527__1564.invoke (repl.clj:91)
cursive.repl.socket_repl$handler.invokeStatic (socket_repl.clj:62)
cursive.repl.socket_repl$handler.invoke (socket_repl.clj:46)
cursive.repl.socket_repl$read_loop$fn__4218$fn__4219.invoke (socket_repl.clj:113)
cursive.repl.socket_repl$read_loop$fn__4218.invoke (socket_repl.clj:110)
cursive.repl.socket_repl$read_loop.invokeStatic (socket_repl.clj:103)
cursive.repl.socket_repl$read_loop.invoke (socket_repl.clj:70)
cursive.repl.socket_repl$start_session$reify__4245.run (socket_repl.clj:181)
com.intellij.openapi.application.impl.ApplicationImpl$1.run (ApplicationImpl.java:263)
java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
java.util.concurrent.FutureTask.run (FutureTask.java:264)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run (Executors.java:668)
java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run (Executors.java:665)
java.security.AccessController.doPrivileged (AccessController.java:-2)
java.util.concurrent.Executors$PrivilegedThreadFactory$1.run (Executors.java:665)
java.lang.Thread.run (Thread.java:829)
' was reported 6220 times#2022-12-3104:06cflemingHi, sorry it took me a while to get to this. So I understand the mechanics of what’s going on, but I can’t understand how you’d get into that state. Briefly, when using the socket REPL, Cursive creates a handler for each evaluation which handles the response. This handler is usually discarded when the eval is done, but you seem to be receiving a response for an eval after that has happened. Are you doing anything like printing on background threads, or anything like that? Is there any particular situation which provokes this?#2022-12-3104:57salam> Are you doing anything like printing on background threads, or anything like that?
the only suspect in the code that’s close to this is a core.async go-loop that calls a function that prints out logs. what’s odd, though, is that i don’t get the same error message when i run the same code in nREPL.#2022-01-0623:21cflemingYeah, I’d expect that. The nREPL protocol is different, and allows multiple parallel executions, so it assigns an ID to each eval and Cursive associates that with the corresponding handler. I could do the same with the socket protocol, it’s not a difficult change.#2021-12-2402:14Mr. SavyI'm getting "cannot be resolved" errors in my fulcro project after incorporating deps. I tried looking up some solutions to no avail. Is there a troubleshooting guide anywhere for this problem?#2022-12-2722:47cflemingWhich symbols are not resolving? Can you send a screenshot?#2022-12-2820:21Mr. Savyit's anything passed into defresolver or defstate from what i'm seeing. I haven't seen any other places where this happens yet.
Here's an example file that I can recreate the issue with. I'm not sure if it matters, but for the dependencies i've tried it with deps, depstar, and dev (which I think is custom) loaded.#2022-12-2902:03cflemingI think the solution there would be to customise the symbol resolution (https://cursive-ide.com/userguide/macros.html#customising-symbol-resolution) for defresolver as defn.#2022-12-2902:45Mr. Savyi'll look into this, thank you!#2022-12-2707:32Fudgehow to read a json file in clojure#2022-12-2721:11AJ JaroThis is probably a better question for #clojure, but previously I’ve used https://github.com/dakrone/cheshire to parse json#2022-12-2722:47cflemingYes, definitely a better question for #clojure, this channel is for discussion related to Cursive.#2022-12-2714:57griersonHey, Can I setup many clojure projects (deps.edn) within one Intellij Idea/git project? Don't need to share dependencies across projects just want to maintain them all within one project. Like a .sln file within C#
myproject/
shopping-cart
deps.edn
code.clj
other
deps.edn
code.clj#2022-12-2722:48cflemingYep, you can import a project like this using https://cursive-ide.com/userguide/deps.html#working-with-multi-module-projects, or you can just add new modules to an existing project any time.#2022-12-2715:11mishagreetings! is this known?
usage/resolution highlights suggest first x is used in :or , when in fact the one from :keys [x y] is used.
(let [x 1
{:keys [x y] :or {y x}} {}]
[x y])
=> [nil nil]
#2022-12-2722:52cflemingI’m not sure, there are a few errors around :or, but it’s hard to search for in Github since it ignores the colon. I can’t see anything matching that case though, could you file an issue?#2022-12-2917:46mishahttps://github.com/cursive-ide/cursive/issues/2629#2022-12-2917:47mishathanks!#2022-12-2918:37gravApparently, relying on possibly destructured keys is undefined behaviour. In this case, the run-time seems to disagree with Cursive's static analysis, but neither is "correct", if I understand it correctly 🙂
https://clojurians.slack.com/archives/C03S1KBA2/p1639584960418600#2022-12-2918:41gravOr maybe, rather, anything is correct. Watch out that you're not launching any rockets, @U051HUZLD 😄#2022-12-2919:00mishaI replaced my spec-based implementation with a call to clojure.core/destructure, so I'll accept any destination where ever it takes me :D#2022-12-2915:29ikitommiwould it be possible to handle the Plumatic Schema type hints with different color, e.g. greyed out? testing how that would work with malli, something like this:#2022-12-2915:31ikitommior similar to java/kotlin, showing/hiding the argument names/types when not needed.#2022-12-3104:08cflemingIt would require some work, but it could be done, yes. But it would only work when the schema is in a known location relative to a macro form like your defn examples. I think in Malli the types are often in arbitrary datastructures, right?#2022-12-3107:43ikitommi95% of the time, those hints would be in same place as with schema, just different defn and fn macros.#2022-12-3108:33ikitommiactually, I think it's more 98%. Currently setting the (experimental) malli (plumatic-style) defn munually as resolve as schema.core/defn, but once it gets released, could the mappings be shipped with Cursive itself?#2022-12-3109:11cflemingYes, for sure. Let me know when they’re nailed down, and if there are any differences from Schema (or any differences you’d like to introduce)#2022-01-0916:34ikitommiIt’s malli.experimental/defn and works identically to schema.core/defn. Might move to another ns when 1.0.0 ships, but not likely to happen any time soon.#2022-01-0916:34ikitommihttps://twitter.com/ikitommi/status/1480215765143932931#2022-12-2915:29ikitommi#2022-12-2918:01gregI noticed in the Cognitect Datomic docs a pretty nice trick with dereferencing defs: when you use @(def ) (instead of just (def ...)) , and you evaluate it, it not only creates a var but also evaluates it, showing the value of the var in the repl. The thing is the Cursive complains about it and it doesn't look good. Is there a way to get away of this warning?#2022-12-3104:09cflemingI don’t think there is, no - if you could file an issue I’ll see if I can fix that.#2022-01-0312:53gregI created the issue here:
https://github.com/cursive-ide/cursive/issues/2630#2022-12-2922:31borkdude#2022-01-0315:29gregworks really nice! thanks @U04V15CAJ @UQTHDKJ8J#2022-01-0315:30borkdudeThis plugin has now been released to the marketplace:
https://plugins.jetbrains.com/plugin/18108-clojure-extras/#2022-01-0319:06zxspectrryep works great, ty ty#2022-01-0319:24borkdudeConsider giving @UQTHDKJ8J's awesome plugin a review here: https://plugins.jetbrains.com/plugin/18108-clojure-extras/#2022-01-0414:40Aurélien Bottaziniawesome. I added a review 😉#2022-01-0722:24JHi guys! Is there an extra config to enable clj-kondo inspection because not work for me (only evalution form)#2022-01-0722:25borkdude@UHZPYLPU1 if you go to "tools" then you will find "clojure-extras" and there is a checkbox#2022-01-0722:26JHere the config on my editor#2022-01-0722:27borkdudeShould be good then. I hope @UQTHDKJ8J can help you with the issue.#2022-01-0821:06JFor you record, if I use clj-kondo executable path, it works.#2022-01-0821:07borkdudeI see. And if you leave it empty it doesn't?#2022-01-0821:17JExactly#2022-01-0821:18borkdudeThen it's great that we have this binary option available :)#2022-01-0821:18borkdudeNot sure what's going on though. Perhaps @UQTHDKJ8J will help soon#2022-01-0821:22brcostaHi guys, sorry to hear that, i'll improve the error messages/logging to make it easier to understand what is going on in this case#2022-01-0821:33JNo worries @UQTHDKJ8J ! Thanks for this very cool plugin and thanks @U04V15CAJ for clj-kondo!#2022-01-0315:30borkdudeThis plugin has now been released to the marketplace:
https://plugins.jetbrains.com/plugin/18108-clojure-extras/#2022-12-3016:24simongrayCLJC static analysis doesn’t seem to work correctly for me now...? I have a worse example, but this should be enough (cannot resolve s in the CLJS part):#2022-12-3104:10cflemingYeah, the static analysis sometimes struggles with CLJC, especially around interop. I’m planning to look at this soon since CLJC is about to get more complicated with ClojureDart.#2022-12-3106:43simongrayThanks a lot, Colin.#2022-12-3016:31Colin P. HillIs there any way in the code style options to reformat this
(filter even?
(range 1 10))
into this?
(filter even?
(range 1 10))
At my company, we use cljfmt to enforce this code style in CI, and I haven't been able to figure out how to replicate it in Cursive's settings.#2022-12-3016:36Jordan Robinsonthis may or may not help, but cljstyle will do that for you automatically if you set it up as a file watcher#2022-12-3016:36Jordan Robinsonproblem being that cljfmt has very different rules apart from that one, so you may need to disable basically everything else#2022-12-3016:50shinichyI use cljfmt with File Watchers plugin to format a file on save.
You can build cljfmt as a native binary using GraalVM.
https://plugins.jetbrains.com/plugin/7177-file-watchers
git clone
cd cljfmt/cljfmt
lein native-image
# Check the binary
target/cljfmt check
#2022-12-3017:00Colin P. HillAhh, never played with Graal and didn't think of it. I'll try that, thank you!#2022-12-3104:00cfleming@U029J729MUP You’ll want to set the indent for filter to “Function” - see: https://cursive-ide.com/userguide/formatting.html#code-style-settings#2022-12-3104:02cflemingYou’ll want to do that even if you use the File Watcher workaround, because the internal formatter is used for a lot of things (e.g. where the caret goes on the new line when you press enter)#2022-12-3112:50Colin P. Hill@U0567Q30W My issue was actually that I had this enabled (pretty sure it was the default). Took me a while to try unchecking it because it wasn't clear to me what "only indent" meant.#2022-01-0103:40cflemingOh, yes, that would do it. It’s not on by default, but even if you have it on you can override it for particular forms. But if you want to match cljfmt you want that off, for sure.#2022-12-3112:18mathias_dwHi, I finally switched to cursive completely because of emacs pinky 🙂. One piece of functionality I can't seem to find is the inspection of vars that i use a lot in cider. Is there a way in cursive to browse the data in vars in the repl, so without having to set a breakpoint somewhere.#2022-01-0103:40cflemingThere isn’t but it’s something I’m planning to add very soon, similar to the new REPL diff functionality.#2022-01-0113:57mathias_dwgreat, thanks!#2022-12-3116:01potetmYou mean, besides evaluating the var in the repl?#2022-12-3117:51mathias_dwI mean browsing the referenced data. I'm always working with very large data structures, so just printing it is not useful. cider gives you a "browser" to iteratively explore the data structure, navigating into the nested parts#2022-12-3117:52mathias_dwi think vlaaad.reveal is supposed to offer the same, but i just spent a few hours to try and make it work with my old leiningen project, without much success#2022-12-3117:53mathias_dwI was hoping to get the intellij debugger to explore data for the vars in the repl, really...#2022-12-3118:20R.A. PorterYou might want to look at Portal as well. It's pretty trivial to get hooked into a project and the beta of the IJ plugin works okay.#2022-12-3119:12mathias_dwCool, thanks, portal looks exactly like what I'm looking for!#2022-01-0318:59genekim+1 on this. Portal inside of Cursive/IntelliJ is freaking amazing.#2022-01-0312:46gregI tried to use "Clojure Application" configuration to run my custom namespaces that kicks off my repl. I noticed that if I choose "Run with Deps" I got:
class java.lang.Character cannot be cast to class java.lang.String (java.lang.Character and java.lang.String are in module java.base of loader 'bootstrap')
while when I choose "Run with IntelliJ proejct classpath" it starts ok (but complains later because the given namespace does not exist in the classpath because it is added only in specific deps alias - I guess this part is normal).#2022-01-0322:00cflemingThere’s an issue for this, I’ll look at it for the next EAP: https://github.com/cursive-ide/cursive/issues/2617#2022-01-0319:10genekimJust curious: how often do y’all update IntelliJ? I think I had one bad experience 2 or 3 years ago, and so now I update maybe once per year. (I just learned you can upgrade Cursive independent of IntelliJ upgrades! Duh.)#2022-01-0615:33AJ JaroI regularly update IntelliJ and Cursive; no issues here…for now. 😉#2022-01-0319:30Alex Miller (Clojure team)ditto :)#2022-01-0319:33imreYou learn something new every day#2022-01-0319:35R.A. PorterI had a bad experience once, but the most I've done is stopped using EAPs.
I "survived" the OSX update that nuked Java (by "survived", I mean I moved to a PC for several years), so my threshold is a bit higher. 😄#2022-01-0319:46imreI am on the EAP channel of both IJ and Cursive. For IJ I usually upgrade to builds that my must-have plugins support unless I see problems posted in this channel. For Cursive I usually upgrade at the first opportunity after a new build comes out#2022-01-0321:09Jeff Evansis it possible to disable (ideally temporarily) the Aviso exception printer when running a test?
in essence, I’m running into this: #2022-01-0321:58cflemingI don’t think there is, unfortunately. The way this works in Cursive is that when you print an exception, it checks to see if the namespace is loaded, and uses it if so. Perhaps you could just unload the Aviso namespace in tests?#2022-01-0420:45GuessBurgerI spotted something strange with Cursive's REPL. I was having issues with some string formatting code I was writing and while debugging I found the cause was that when I eval " a \n b " it appears to trim the whitespace after the newline on the returned string to " a \nb ". This is the case whether a function returns that value or just the string is eval-ed but println-ing works fine (see screenshot).
A colleague also reported seeing the same thing. Is there a flag we have checked that's causing this? I've looked through my settings and tried searching for it on the Cursive site but can't find anything.#2022-01-0420:56cflemingI should add a section to the Troubleshooting page about this, sorry, that’s Preferences | Languages & Frameworks | Clojure | REPL Options | Split and align multi-line strings#2022-01-0421:11GuessBurgerNo problem, I obviously didn't look close enough 😅
Thank you for getting back to me so quickly!#2022-01-0421:27cflemingNo worries! That’s so that when you print out data structures containing formatted strings, they look nice. That’s useful, but for the case where you’re actually developing code that depends on formatted strings, it can be weird.#2022-01-0421:31cflemingI’ve updated the doc for this, it’ll go out on the next push.#2022-01-0613:51Mateusz MazurczakHi, I'm using intellij on ubuntu.
I can't see any dependencies because I get an error.
In clojure deps -> projectname -> /my/project/path/deps.edn: status code: 401, reason phrase: Unauthorized (401)
I changed permisions for both intellij and my project to give full access (ls -l), but it shows the same error
Any ideas how to solve it?#2022-01-0617:44Mateusz MazurczakI was missing .m2/settings.xml for datomic#2022-01-0613:59Alex Miller (Clojure team)Does it work outside cursive?#2022-01-0614:00Alex Miller (Clojure team)That's an http code, so I'd guess it's access to a repository #2022-01-0614:08Mateusz MazurczakYeah I can start the project and everything. It was also working previously and not showing this error. I just fresh installed due to my laptop issues.#2022-01-0615:23folconI've started seeing this error in the Run panel when running my REPL run configuration, which is really unhelpful for debugging what's wrong with it. Any ideas what's happening / how I could debug this?
Suppressed exit
#2022-01-0620:07cflemingThat error is coming from Leiningen. What that usually means is some code in lein is trying to exit the process, and Cursive is preventing it so that it doesn’t dump the whole Cursive process. The usual culprit is a lein plugin. If you look in your log (Help | Show log in Finder/Explorer), you should see a line somewhere: “Exit called in Leiningen” which will give you a stacktrace to where it happened.#2022-01-0620:08cflemingThat will hopefully help to diagnose the problem.#2022-01-1221:59folconThanks for the quick response @U0567Q30W, sorry I took a while to get back to you, managed to find it, now I need to work out why it's throwing a null exception instead of the expected compilation error...
#cursive.shim.IndicatorBridge - Exit called in Leiningen:
java.lang.RuntimeException: null
at cursive.leiningen.project$add_standard_hooks_BANG_$fn__2318$fn__2319.invoke (project.clj:515)
cursive.leiningen.project$add_standard_hooks_BANG_$fn__2318.doInvoke (project.clj:515)
clojure.lang.RestFn.applyTo (RestFn.java:139)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
cursive.leiningen.hooke$compose_hooks$fn__1838.doInvoke (hooke.clj:43)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invokeStatic (core.clj:665)
clojure.core$apply.invoke (core.clj:660)
cursive.leiningen.hooke$run_hooks.invokeStatic (hooke.clj:49)
cursive.leiningen.hooke$run_hooks.invoke (hooke.clj:48)
cursive.leiningen.hooke$prepare_for_hooks$fn__1843$fn__1844.doInvoke (hooke.clj:57)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
clojure.lang.RestFn.invoke (RestFn.java:408)
leiningen.javac$run_javac_subprocess.invokeStatic (javac.clj:133)
leiningen.javac$run_javac_subprocess.invoke (javac.clj:115)
leiningen.javac$javac.invokeStatic (javac.clj:147)
leiningen.javac$javac.doInvoke (javac.clj:136)
clojure.lang.RestFn.invoke (RestFn.java:410)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.RestFn.applyTo (RestFn.java:132)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
leiningen.core.main$partial_task$fn__7356.doInvoke (main.clj:284)
clojure.lang.RestFn.invoke (RestFn.java:410)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.RestFn.applyTo (RestFn.java:132)
clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
leiningen.core.main$apply_task.invokeStatic (main.clj:334)
leiningen.core.main$apply_task.invoke (main.clj:320)
clojure.lang.AFn.applyToHelper (AFn.java:160)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invokeStatic (core.clj:665)
clojure.core$apply.invoke (core.clj:660)
cursive.leiningen.hooke$run_hooks.invokeStatic (hooke.clj:49)
cursive.leiningen.hooke$run_hooks.invoke (hooke.clj:48)
cursive.leiningen.hooke$prepare_for_hooks$fn__1843$fn__1844.doInvoke (hooke.clj:57)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
clojure.lang.RestFn.invoke (RestFn.java:436)
leiningen.core.eval$run_prep_tasks.invokeStatic (eval.clj:51)
leiningen.core.eval$run_prep_tasks.invoke (eval.clj:43)
leiningen.core.eval$prep.invokeStatic (eval.clj:86)
leiningen.core.eval$prep.invoke (eval.clj:73)
cursive.leiningen.task$prep_hook$fn__2418.invoke (task.clj:41)
clojure.lang.AFn.applyToHelper (AFn.java:156)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
cursive.leiningen.hooke$compose_hooks$fn__1838.doInvoke (hooke.clj:43)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invokeStatic (core.clj:665)
clojure.core$apply.invoke (core.clj:660)
cursive.leiningen.hooke$run_hooks.invokeStatic (hooke.clj:49)
cursive.leiningen.hooke$run_hooks.invoke (hooke.clj:48)
cursive.leiningen.hooke$prepare_for_hooks$fn__1843$fn__1844.doInvoke (hooke.clj:57)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
clojure.lang.RestFn.invoke (RestFn.java:408)
leiningen.core.eval$eval_in_project.invokeStatic (eval.clj:364)
leiningen.core.eval$eval_in_project.invoke (eval.clj:358)
clojure.lang.AFn.applyToHelper (AFn.java:160)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
cursive.leiningen.task$eval_hook$fn__2415.doInvoke (task.clj:30)
clojure.lang.RestFn.applyTo (RestFn.java:142)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
cursive.leiningen.hooke$compose_hooks$fn__1838.doInvoke (hooke.clj:43)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invokeStatic (core.clj:665)
clojure.core$apply.invoke (core.clj:660)
cursive.leiningen.hooke$run_hooks.invokeStatic (hooke.clj:49)
cursive.leiningen.hooke$run_hooks.invoke (hooke.clj:48)
cursive.leiningen.hooke$prepare_for_hooks$fn__1843$fn__1844.doInvoke (hooke.clj:57)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
leiningen.repl$repl.invokeStatic (repl.clj:393)
leiningen.repl$repl.doInvoke (repl.clj:319)
clojure.lang.RestFn.invoke (RestFn.java:425)
clojure.lang.AFn.applyToHelper (AFn.java:156)
clojure.lang.RestFn.applyTo (RestFn.java:132)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
leiningen.core.main$partial_task$fn__7356.doInvoke (main.clj:284)
clojure.lang.RestFn.applyTo (RestFn.java:139)
clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
leiningen.core.main$apply_task.invokeStatic (main.clj:334)
leiningen.core.main$apply_task.invoke (main.clj:320)
clojure.lang.AFn.applyToHelper (AFn.java:160)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.core$apply.invokeStatic (core.clj:665)
clojure.core$apply.invoke (core.clj:660)
cursive.leiningen.hooke$run_hooks.invokeStatic (hooke.clj:49)
cursive.leiningen.hooke$run_hooks.invoke (hooke.clj:48)
cursive.leiningen.hooke$prepare_for_hooks$fn__1843$fn__1844.doInvoke (hooke.clj:57)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
clojure.lang.RestFn.invoke (RestFn.java:436)
leiningen.core.main$resolve_and_apply.invokeStatic (main.clj:343)
leiningen.core.main$resolve_and_apply.invoke (main.clj:336)
cursive.leiningen.task$task_details$fn__2441.invoke (task.clj:79)
cursive.leiningen.task$task_details.invokeStatic (task.clj:74)
cursive.leiningen.task$task_details.invoke (task.clj:43)
clojure.lang.Var.invoke (Var.java:388)
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke (ClojureRuntimeShimImpl.java:119)
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke (ClojureRuntimeShimImpl.java:112)
cursive.shim.ShimBootstrap$Shim.apply (ShimBootstrap.java:53)
cursive.repl.runner.LocalConfiguration$createLeinParameters$ret$1.invoke (ReplRunConfigurations.kt:463)
cursive.repl.runner.LocalConfiguration$createLeinParameters$ret$1.invoke (ReplRunConfigurations.kt:462)
cursive.shim.ShimProvider.withShim (Shim.kt:117)
cursive.repl.runner.LocalConfiguration.createLeinParameters (ReplRunConfigurations.kt:462)
cursive.repl.runner.LocalConfiguration.access$createLeinParameters (ReplRunConfigurations.kt:393)
cursive.repl.runner.LocalConfiguration$getRunProfileState$1.createDeferredParameters (ReplRunConfigurations.kt:432)
cursive.runner.DeferredCommandLineState.cacheDeferredParameters (Deferred.kt:72)
cursive.runner.AbstractDeferredRunner$execute$1.run (Deferred.kt:104)
com.intellij.openapi.progress.impl.CoreProgressManager.startTask (CoreProgressManager.java:450)
com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask (ProgressManagerImpl.java:117)
com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5 (CoreProgressManager.java:510)
com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3 (ProgressRunner.java:243)
com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2 (CoreProgressManager.java:183)
com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun (CoreProgressManager.java:705)
com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress (CoreProgressManager.java:647)
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress (ProgressManagerImpl.java:63)
com.intellij.openapi.progress.impl.CoreProgressManager.runProcess (CoreProgressManager.java:170)
com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4 (ProgressRunner.java:243)
java.util.concurrent.CompletableFuture$AsyncSupply.run (CompletableFuture.java:1700)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run (Executors.java:668)
java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run (Executors.java:665)
java.security.AccessController.doPrivileged (AccessController.java:-2)
java.util.concurrent.Executors$PrivilegedThreadFactory$1.run (Executors.java:665)
java.lang.Thread.run (Thread.java:829)#2022-01-1301:07cflemingThanks for that - the problem is in leiningen.javac/run-javac-subprocess, which looks like this: https://github.com/technomancy/leiningen/blob/b257a5ac02af51e1b89332c667e57c9e01f98d7e/src/leiningen/javac.clj#L115-L134. As you can see, it’s some exception executing javac which calls main/exit. Do you see any error output anywhere which might help? There’s a comment above that function discussing how the output is handled, but I must admit I don’t understand it. I think it’s saying that the output will just go to the standard process output, but since it looks like it runs javac in a separate process I don’t know where that will end up.#2022-01-1301:13cflemingLooks like there’s not much information apart from the exit code available anyway: https://github.com/technomancy/leiningen/blob/b257a5ac02af51e1b89332c667e57c9e01f98d7e/leiningen-core/src/leiningen/core/eval.clj#L261-L266#2022-01-1415:29folconOk, good to know.#2022-01-0618:29Josh HorwitzAnyone have any tips or guides on using Cursive with ideavim plug in? Or an ideavimrc they would like to share, having a tough time making the workflow as seamless as I think it can be#2022-01-0620:10cflemingThere’s a couple of pages here: https://github.com/cursive-ide/cursive/wiki/IdeaVim-issues#2022-01-0620:10cflemingIt’s also been discussed on the mailing list from time to time: https://groups.google.com/g/cursive/search?q=ideavim#2022-01-0623:27dvingoIf you are trying to solve a mystery of why some keybindings aren't working knowing about Preferences -> Editor -> Vim can help a ton. Certain bindings you might want the IDE to interpret vs the IdeaVim plugin.#2022-01-0700:05Josh Horwitz Thanks all!#2022-01-0716:31Grant HornerIs there any way for me to run clojure tests in cursive using a deps.edn alias, while also using "Run with Intellij project classpath"? I really like the IDE integration of using the Intellij project classpath, but I have a separate "test" alias set up for testing (duh) that I haven't been able to figure out how to activate.#2022-01-0716:46imrehave you found the clojure deps tool window?#2022-01-0716:47imreit has an aliases section you can expand, tick the aliases you want on the IJ classpath, refresh clojure project (spinny wheel icon at the top), and start a new repl#2022-01-0716:47imreor is there some project setting preventing you from doing that?#2022-01-0717:59Grant HornerThat was exactly the problem - I needed to check the aliases and tool aliases in there#2022-01-0818:21Mateusz MazurczakHi, js/window.location is highlighted as an warning (js/window.location.hash cannot be resolved).
Other js functions are fine like for example:
(js/encodeURIComponent url)
How can I ignore it in Intellij or help it be resolved?#2022-01-0912:45zxspectrris it possible add a key binding for a custom repl command?#2022-01-0913:57markaddlemanYes. Every repl command is available in the Key Mapping dialog in settings#2022-01-0914:23zxspectrrah yea, got it. thanks!#2022-01-0912:46zxspectrri'm interested in executing
(integrant.repl/reset)
via a hotkey#2022-01-1014:08Aurélien Bottazini👋 So some time ago, I finally took some time to figure out what was happening with an exception thrown by cursive.
Context is: sometimes I work on JS projects where there is no clojure code.
The node_modules still get parsed by cursive. And I get errors like that:#2022-01-1014:09Aurélien BottaziniIt took me some time to realise that cursive was not really at fault. It’s just that the JS library in question is malformed and has most certainly a bug#2022-01-1014:10Aurélien BottaziniThe way i “solve” (= make sure cursive does not throws an exception anymore) is by overriding the file type to plain text:#2022-01-1014:11Aurélien BottaziniWorks for me because i don’t care that this nested node_module dependency is not analyzed by Intellij.#2022-01-1014:11Aurélien BottaziniI think a note in the troubleshooting section of cursive’s user guide would be helpful to others 😉#2022-01-1110:43Al Z. HeymerI'm currently working on some logging. Because I now added the Thread-name (%thread) I now get a quite disruptive name in my REPL:
[2022-01-11 11:34:16,394][nRepl-session-ad588086-616b-4da7-89ac-9d5e094c1e86] INFO d.c.c.caches - KB caches created.
Is it possible to rename the nrepl-session to main ?#2022-01-1113:14Al Z. HeymerTo clarify: I do not mean by (.setName thread' "main") but by settings in the REPL-profile, like Environment#2022-01-1120:40cflemingThat’s really an nREPL question, I’m not sure about that. If you can figure out the mechanism that nREPL uses, if one exists, then I can help you set that up in Cursive.#2022-01-1209:40dazldDo any of you know a good way to force nrepl output to go into the replpanel inside intelliJ?#2022-01-1209:51imreWhere else is it going?#2022-01-1209:53dazldInto the nrepl output in terminal, sadly#2022-01-1209:54imreI take it you run nrepl from the terminal then connect with Cursive?#2022-01-1210:02dazldcorrect#2022-01-1210:04dazldhow does clojure decide which stream should get a particular ouptut? I can see the values of *out* are different in the terminal and in cursive, for example.
terminal:
*out*
#object[java.io.PrintWriter 0x207e6102 "
#2022-01-1210:04imreI'm not sure this is a Cursive thing, more of an nrepl one#2022-01-1210:05imreafaik nrepl works on a request-response basis#2022-01-1210:05imrecursive sends a request, nrepl replies#2022-01-1210:06imreif you start nrepl outside of cursive, the latter won't have any control over the streams nrepl uses#2022-01-1210:07imrePerhaps there is a way to configure nrepl itself to send stdout to its clients, but I wouldn't bet on it#2022-01-1210:07imreDo you have to start nrepl outside or can you start it from inside cursive?#2022-01-1210:08imreI normally do the latter and nrepl output goes to the repl pane in that case#2022-01-1210:08dazldgenerally, I’ve been doing like you, and starting a repl inside cursive - however, the project I’m working on has stuff working in parallel to the nrepl, so it might not work.#2022-01-1210:09dazldhand on heart, I haven’t tried yet tho, was just wondering if there was a simple way to grab all the nrepl output into cursive ;)#2022-01-1220:42cflemingThis is a kind of murky area. nREPL does send output from evaluations to the client, and you should see those. For example, if you execute (println "Hello"). nREPL does this by binding *out* during evaluations, but that doesn’t work for everything, for example anything using System.out or anything kicked off from an eval which prints on a separate thread. If Cursive starts the REPL, then it controls the process and it will send the extra process output to the REPL pane too, but it can’t do that if you start it on the command line and then connect.#2022-01-1309:07Ivar RefsdalHi @U3ZUC5M0R
There is https://github.com/nrepl/nrepl/issues/119 (by me) which links https://gist.github.com/daviesian/4517859.
Personally I just make sure (when I'm running nrepl in the terminal) to evaluate that fix before doing any nrepl stuff --- i.e. I'm requiring a namespace that does the fix.#2022-01-1309:10dazld@UGJE0MM0W amazing, that worked! thank you!#2022-01-1313:15Ivar RefsdalGlad I could help!#2022-01-1316:10dazld@U0567Q30W perhaps an option could be added for remote repls? I guess it’d need to restore `*out*` bindings on close as well, and perhaps disable opening more than one repl if it’s selected.#2022-01-1212:19borkdudeclojure-extras: a plugin which builds on Cursive and adds extra features like clj-kondo linting, and inline eval:#2022-01-1214:17imreWhat exactly are the differences between using built-in clj-kondo vs specified from path?#2022-01-1214:18borkdudethe built-in one is running in a JVM and should be faster one it's started, the binary is used to shell out to every time you change something, which should also work fine#2022-01-1214:20imrebut if I use the binary then I might get updates quicker via brew, is that a good assumption?#2022-01-1214:24borkdudecorrect#2022-01-1214:24borkdudebut I hope and also think @UQTHDKJ8J will keep the plugin up to date#2022-01-1214:24borkdudeand else you can help by doing so via a PR#2022-01-1214:29imreThank you for the info#2022-01-1214:29imrethis is a much much nicer integration already than file watcher or lsp#2022-01-1214:29imreat least in my experience#2022-01-1221:36souenzzomaybe in the future we can add a version selector like this, then we will be able to choose the version directly from maven.#2022-01-1221:41borkdudeGood idea, but that would mean clj-kondo would have to run in its own process rather than in the plugin. Still possible though, for example using the pod interface that it already has.#2022-01-1221:55souenzzoNot sure how cursive does, if it spawns a new process, or if use some advanced classpath thing from intellij
if it spawn a new process, the communication can be done via pod -like process 👀#2022-01-1221:57borkdudeyes#2022-02-1114:44DumchAbout the ‘open repl file buffer’. I would definitely like to be able to work with it like with plain text buffer, being able to modify it, copy and use it with vimium plugin. https://www.reddit.com/r/Clojure/comments/lzx0zb/did_you_know_that_ideacursive_repl_results_may_be/ to achieve it with ‘add new repl command’ (may be someone will find it useful).#2022-02-1114:44borkdude@UL05W6AEM There's a channel now: #clj-extras-plugin#2022-01-1215:52jacekschaeCursive supports converting HTML to Hiccup on paste. Would it be possible to have the same thing for Fulcro's HTML? There is even a functions that does the job at Developers Guide -- https://book.fulcrologic.com/#_converting_html_to_fulcro. Would people be interested in this feature? cc: @tony.kay#2022-01-1220:45cflemingThe problem is knowing which to convert to, I guess that would have to be a project-specific flag, possibly with a checkbox on the popup. But I can do that, sure. Could you file an issue for that?#2022-01-1305:00jacekschaeThanks Colin!
Project specific sounds like a good idea to me.
Here's the issue: https://github.com/cursive-ide/cursive/issues/2636#2022-01-1311:43JoniI am pretty sure I used to be able to change the indentation of the arrow macros from this context actions before, but now the option is gone? Also there doesn't seem to be an option for this in the code style preferences. Is this something intended or is something broken on my end?#2022-01-1312:42imreWorks for me using IntelliJ IDEA 2021.3.1 (Community Edition)
Build #IC-213.6461.79, built on December 28, 2021
com.cursiveclojure.cursive (1.12.2-eap1-2021.3)#2022-01-1312:43JoniAa interesting, seems to work in another project.#2022-01-1621:03cflemingCheck Preferences | Editor | Intentions and make sure that the relevant Clojure ones are enabled. Does that help?#2022-01-1315:44octahedrionwhat does it mean when clicking on an exception link doesn't jump to the line in the source but instead brings up a popup list saying "choose target file" ? If I click on any of the files listed it jumps to that line in that file, but why would I want to jump to that line in any other file but that which contains the function in which the exception occurred ?#2022-01-1318:14jmvi'm having an issue trying to open a lein project. it indicates that none of the files are under a source or test root and when i try to click the refresh button on the lein panel, i get this error:
10:11 AM Error reading /Users/jeremiah/src/the-project/project.clj
fatal: not a git repository (or any of the parent directories): .git
which is also odd because i just checked out the repo from git#2022-01-1318:36manutter51That's odd, have you tried typing git status at the command line to see if git thinks it's a valid project?#2022-01-1318:44jmvyep, git works just fine
> git status
On branch master
Your branch is up to date with 'origin/master'.
#2022-01-1318:44jmvalso git in intellij works just fine as well#2022-01-1318:45R.A. PorterI don't think that has anything to do with your repository. I think it's a dependency in your project.clj. Do you have one in there referencing a git repo?#2022-01-1318:47R.A. PorterProbably quicker...can you run the lein project from the command line?#2022-01-1318:52manutter51There's also lein deps :tree, though that might throw the same error.#2022-01-1318:53manutter51(Which might be a helpful diagnostic, actually.)#2022-01-1319:23jmvi can run all the lein commands normally. i normally use the project from emacs/cider and it works just fine.#2022-01-1319:23jmvbut let me double check it's not some lein plugin#2022-01-1319:24jmvah yep, it's a plugin we use that sources the project version from git instead of hard coding it#2022-01-1400:47jmvhello again! is there anything special that needs to be done for cursive to pickup lein middleware? i have this working with both emacs and vscode but with cursive i get an error trying to load the project. i'm trying to load my middleware version-from-git and hitting this error:
STDERR - Error: cannot resolve leiningen.git-release/version-from-git middleware
#2022-01-1408:41borkdudeA new version of clojure-extras (add-on to Cursive) was released to the marketplace (0.4.5): https://plugins.jetbrains.com/plugin/18108-clojure-extras/
It has the newest clj-kondo and fixes a couple of issues. Thank you @brcosta!#2022-01-1415:31folconWhat in the project.clj governs what paths are added to Excluded Folders under the Project Structure? For some reason the path . keeps getting added in one of my projects, which then removes everything and I have to keep manually removing it everytime leiningen synchronises...#2022-01-1702:44cflemingThere have been issues like this before, see e.g. https://github.com/cursive-ide/cursive/issues/525. But there is a check there which should prevent that from happening now.#2022-01-1702:48cflemingThe current list of things which get excluded is: target dir, checkout dir, cljx output-path (probably not using that any more), cljsbuild compiler output-dir. Are you using any of those?#2022-01-1814:48folconThis is my :cljsbuild:
:cljsbuild {:builds
{:dev {:source-paths ["src"]
:compiler {:main example.core
:optimizations :whitespace
:output-to "./Code.js"
:output-dir "target/dev"
:pretty-print true
:externs ["resources/gas.ext.js"]
:foreign-libs [{:file "src/entry_points.js"
:provides ["example.entry-points"]}]}}
:main {:source-paths ["src"]
:compiler {:main example.core
:optimizations :advanced
:output-to "./Code.js"
:output-dir "target/main"
:pretty-print true
:externs ["resources/gas.ext.js"]
:foreign-libs [{:file "src/entry_points.js"
:provides ["example.entry-points"]}]}}}}
If it's not that then I could paste in the whole thing...
The :output-dir in :cljsbuild is targeting a subdir "target/{dev,main}" so not sure why this is happening...
The only other keys I have defined in the defproject are:
:description :url :min-lein-version :dependencies :plugins (which only contains lein-cljsbuild) :source-paths and :clean-targets
#2022-01-2217:17folconI'd normally not prod the channel but this behaviour in cursive is pretty frustrating as it keeps ignoring my entire project every time lein refreshes...
> The :output-dir in :cljsbuild is targeting a subdir "target/{dev,main}" so not sure why this is happening...#2022-01-2219:46cflemingAre you able to send me your whole project.clj? You could DM it or email it to <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection> if you don’t want it to be public.#2022-01-2217:17folconI'd normally not prod the channel but this behaviour in cursive is pretty frustrating as it keeps ignoring my entire project every time lein refreshes...
> The :output-dir in :cljsbuild is targeting a subdir "target/{dev,main}" so not sure why this is happening...#2022-01-1711:18mike_ananev@borkdude, hello! When I use clojure-extras, evaluate top form (inline) then all printlns are suppressed. How to redirect println to terminal where my active repl/jvm session is run ?#2022-01-1711:19borkdudeThis is a question for the maintainer @brcosta :) If you have clj-kondo questions, then please come to #clj-kondo :)#2022-01-1711:19mike_ananevOh! Sorry.#2022-01-1711:20borkdudeI also don't know if @cfleming would be ok if we used this channel to discuss clojure-extras issues, if so, we could dedicate a new channel for this. Please let us know, I don't want to get on anyone's nerves.#2022-01-1711:22borkdudeWe can at least use 🧵 for discussions. /cc @brcosta @U097654L8#2022-01-1711:22mike_ananev👍#2022-01-1711:23mike_ananev(defn abc [a b]
(let [x (* a a)
y (* b b)
result (+ x y)]
(println "result" result)
result))
(abc 2 4)
#2022-01-1711:23brcostaThanks!#2022-01-1711:24mike_ananevprintln is suppressed. I can't see result of println (neither in terminal, nor in repl/cursive window)#2022-01-1711:38brcostaok, I’ll take a look later today#2022-01-1711:43borkdudeyou can also make an issue here @U097654L8#2022-01-1711:43borkdudehttps://github.com/brcosta/clj-stuff-plugin#2022-01-1712:05mike_ananev@brcosta I've created an issue https://github.com/brcosta/clj-stuff-plugin/issues/7#2022-01-1721:10cflemingYeah, it’s probably better to create a separate channel, since I can’t really do anything about extras issues.#2022-01-1721:31borkdudeOK @brcosta: #extras-idea-plugin or so? I'll let it up to you to create it :)#2022-01-1912:10brcostaHi @U097654L8, created #clj-extras-plugin for this reports, also 0.5.0 is released with the fix for stdout redirection, please give it a try 🙂#2022-01-1921:41mike_ananev@brcosta 👍#2022-01-2409:08Schpaa@brcosta When the inline eval hangs forever with a Evaluating-popup, what could be wrong?#2022-01-2409:21borkdude@UBKAXK5QB There is now a #clj-extras-plugin channel, I think it'd be good to post there#2022-01-1711:23mike_ananev@brcosta see example in a thread.#2022-01-1716:04Kari MarttilaAnyone noticed some weird behavior with Cursive and Integrant? I have a Cursive remote REPL configuration (nrepl). Occasionally I change some function and re-evaluate that var (i.e. not with Integrant (reset) but sending the function to re-evaluation) - and still there seems to be the old functionality. I give command (in-ns 'my-ns) and then *ns* both in terminal clj session and in Cursive REPL window: they tell that the my-ns is different, example:
• In terminal repl: #object[clojure.lang.Namespace 0x1111111 "my-ns"]
• In cursive repl: #object[clojure.lang.Namespace 0x2222222 "my-ns"]
I'm a bit puzzled with this.#2022-01-1721:13cflemingI’m not sure about this, sorry. The only thing I can think of is that it might be related to Cursive’s default behaviour of evaluating in the file ns, which is different to evaluating in the current ns of the REPL? See e.g. here for a problem (not the same as yours) which is also as a result of this behaviour, with a bit of explanation: https://cursive-ide.com/userguide/troubleshooting.html#unresolved-symbols-from-clojure-core-when-sending-forms-to-repl#2022-01-1810:08DumchIt’s possble to use `f` as ‘form’ for selecting in visual mode in spacemacs (by default) and vim (with https://github.com/guns/vim-sexp).
For example, typing `daf` in visual mode will delete a form (“text”, (…), […}, {…}) under the cursor.
Is it possible to achieve something like this in idea with cursive?#2022-01-2008:01Dumchmanaged to solve it with Idea LivePlugin
import com.intellij.openapi.actionSystem.CommonDataKeys
import liveplugin.registerAction
import liveplugin.show
show("Current project: ${project?.name}")
registerAction("SelectForm", "ctrl alt shift W", function = { event ->
val project = event.project
val editor = CommonDataKeys.EDITOR.getData(event.dataContext)
if (project == null || editor == null) #2022-01-1810:09Dumchdoes anyone use some shortcut to insert a #_ comment on any form under a cursor with `idea/cursive`?
originally asked https://clojurians.slack.com/archives/C053AK3F9/p1642494215468300#2022-01-1915:49Dumchmanaged to solve it with idea LivePlugin + ideavim
ideavimrc part:
nnoremap <Leader>c :action insertClojureCommentAtTheFormStart<cr>
live plugin part
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.editor.Document
import liveplugin.executeCommand
import liveplugin.registerAction
import liveplugin.show
import kotlin.math.max
show("Current project: ${project?.name}")
registerAction("insertClojureCommentAtTheFormStart", function = { event ->
val project = event.project
val editor = CommonDataKeys.EDITOR.getData(event.dataContext)
if (project == null || editor == null) #2022-01-1817:44jmvhey all! would anyone be able to recommend the best way to debug a lein middleware issue?
for context: i'm unable to sync a project in cursive with the error log saying it's unable to resolve the middleware function. the middleware works fine when calling lein from the CLI or if i create a lein run configuration.#2022-01-1919:59tjbhey everyone! starting to dig into cursive and when i attempt to run lein figwheel i get the following error
Figwheel: Cleaning because dependencies changed
Figwheel: Cutting some fruit, just a sec ...
java.lang.NullPointerException: null
at leiningen.trampoline$write_trampoline.invokeStatic (trampoline.clj:38)
leiningen.trampoline$write_trampoline.invoke (trampoline.clj:34)
leiningen.trampoline$trampoline.invokeStatic (trampoline.clj:64)
leiningen.trampoline$trampoline.doInvoke (trampoline.clj:41)
clojure.lang.RestFn.invoke (RestFn.java:425)
clojure.lang.AFn.applyToHelper (AFn.java:156)
clojure.lang.RestFn.applyTo (RestFn.java:132)
clojure.core$apply.invokeStatic (core.clj:669)
clojure.core$apply.invoke (core.clj:660)
leiningen.figwheel$figwheel.invokeStatic (figwheel.clj:559)
leiningen.figwheel$figwheel.doInvoke (figwheel.clj:458)
clojure.lang.RestFn.invoke (RestFn.java:410)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.RestFn.applyTo (RestFn.java:132)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
leiningen.core.main$partial_task$fn__7356.doInvoke (main.clj:284)
clojure.lang.RestFn.invoke (RestFn.java:410)
clojure.lang.AFn.applyToHelper (AFn.java:154)
clojure.lang.RestFn.applyTo (RestFn.java:132)
clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
leiningen.core.main$apply_task.invokeStatic (main.clj:334)
leiningen.core.main$apply_task.invoke (main.clj:320)
lein_cprop.plugin$write_env_to_file.invokeStatic (plugin.clj:27)
lein_cprop.plugin$write_env_to_file.invoke (plugin.clj:25)
clojure.lang.AFn.applyToHelper (AFn.java:165)
clojure.lang.AFn.applyTo (AFn.java:144)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)
robert.hooke$compose_hooks$fn__11222.doInvoke (hooke.clj:40)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invokeStatic (core.clj:665)
clojure.core$apply.invoke (core.clj:660)
robert.hooke$run_hooks.invokeStatic (hooke.clj:46)
robert.hooke$run_hooks.invoke (hooke.clj:45)
robert.hooke$prepare_for_hooks$fn__11227$fn__11228.doInvoke (hooke.clj:54)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.lang.AFunction$1.doInvoke (AFunction.java:31)
clojure.lang.RestFn.invoke (RestFn.java:436)
leiningen.core.main$resolve_and_apply.invokeStatic (main.clj:343)
leiningen.core.main$resolve_and_apply.invoke (main.clj:336)
leiningen.core.main$_main$fn__7445.invoke (main.clj:453)
leiningen.core.main$_main.invokeStatic (main.clj:442)
leiningen.core.main$_main.doInvoke (main.clj:439)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.lang.Var.applyTo (Var.java:705)
clojure.core$apply.invokeStatic (core.clj:665)
clojure.main$main_opt.invokeStatic (main.clj:491)
clojure.main$main_opt.invoke (main.clj:487)
clojure.main$main.invokeStatic (main.clj:598)
clojure.main$main.doInvoke (main.clj:561)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.lang.Var.applyTo (Var.java:705)
clojure.main.main (main.java:37)
Process finished with exit code 1
i am looking to boot up this application via cursive https://github.com/CSCfi/rems/blob/master/docs/development.md#2022-01-1920:01tjbi am unsure the reason it is throwing this error (new to clojure) and attempted to use the commands in https://figwheel.org/docs/cursive.html but no dice#2022-01-2608:49Al Z. HeymerDid you successfully start figwheel over the cli?#2022-01-2010:12DumchIf anyone want to comment a form with #_ with a shortcut, select a form vith 'vaf' (https://plugins.jetbrains.com/plugin/164-ideavim), here is how I managed to achieve this with https://plugins.jetbrains.com/plugin/7282-liveplugin (https://github.com/Liverm0r/dotfiles/commit/83f7940c878038cabf5db7f98e9f0e4a1cb20e51 to dotfiles)#2022-01-2020:39JHi cursive lovers! I’m wondering if there is a way to ignore this (when require a js lib with shadow-cljs)#2022-01-2022:03Colin P. HillMy workaround has been to just demote unresolved symbols to a weak warning. Definitely not ideal, though.#2022-01-2107:13thhellerI do the same#2022-01-2107:13thheller@U0567Q30W would it be possible to add an option to treat all string requires :refer or :as uses as valid? without any actual checks?#2022-01-2108:21cflemingYes, I’m planning fixes for this to the current EAP series.#2022-01-2200:32bedersyeah, for js requires that would be terrific. Even more terrific if they are navigable 🙂#2022-01-2206:40cflemingBeing navigable will depend on how parseable the JS is. In my experience of looking at CommonJS modules, the answer is usually not much, sadly.#2022-01-2207:06thhellerthere are a lot of libraries in JS that handle that sort of thing. unfortunately they are in JS and expecting node, would be neat to have a java/clj lib for that but so far I haven't found one#2022-01-2208:35cflemingWhat would be some good examples of JS libraries handling this sort of thing?#2022-01-2208:45thhellerhttps://github.com/nodejs/cjs-module-lexer https://github.com/guybedford/es-module-lexer#2022-01-2208:45thhellerare the ones I can remember. there are others though.#2022-01-2208:47cflemingThanks!#2022-01-2416:13Grant HornerNot sure if this a regression, Mac issue, or ID10T error, but I recently switched from Windows to Mac and ran into an issue with symbol resolution. I set deftest to def , but this doesn’t seem to resolve correctly inside of with-redefs forms. No problem on Windows, but I may be on an older build there.#2022-01-2421:28cflemingI think the issue there is that the deftest is inside the with-redefs - could you check if taking it out helps that?#2022-01-2606:21robert-stuttafordis it possible to set up cursive to auto-format on save using cljfmt?
in emacs, when one uses clojure-lsp, you get lsp-format-buffer, which uses cljfmt under the hood. perhaps cursive uses clojure-lsp and can therefore use cljfmt via lsp?#2022-01-2606:22cflemingNot yet, but it’s something I’m looking into as part of a change I’m just about to release.#2022-01-2606:22cflemingOr rather, I’m about to release the first version of it, it will need more refinement.#2022-01-2606:23robert-stuttafordoh wow you answered quick haha - i just amended my question!#2022-01-2606:25cflemingHaha, yes. I’m planning to support cljfmt in one of two ways, either modifying Cursive to allow its formatting to be configured from the cljfmt file, or by configuring an external formatter which (I think) will allow what you want.#2022-01-2606:26cflemingAre there forms where you can’t get the formatting from Cursive to match cljfmt, or is it just that it’s a pain to maintain the config in two places?#2022-01-2606:26robert-stuttafordok great!#2022-01-2606:26robert-stuttafordso, we have one cursive user and 5 emacs users, and whenever cursive-guy plus anyone else collaborate, the diffs are full of formatting changes#2022-01-2606:27cflemingHas the Cursive user tried to get the formatting to match cljfmt?#2022-01-2606:27robert-stuttafordyes! things like datalog's or-join and tufte/p being indented with two spaces rather than at the end of the function line, and that open issue with map values indenting at the end of the key even though its on a new line#2022-01-2606:28cflemingI’m interested in cases where Cursive can’t support something that cljfmt does. Otherwise it may just be a matter of configuring his Cursive setup.#2022-01-2606:28cflemingCan you give me some examples of the or-join and tufte/p thing? I’ll fix the map value thing in the next EAP (not this one I’m just about to release).#2022-01-2606:31robert-stuttafordsure! we have this cljfmt config:
{:indents {tufte/p [[:inner 0]]
or-join [[:inner 0]]}}
without the config:
(tufte/p :metric-name
(measured-code-here))
(d/q '[:find ?x :where
(or-join [?x]
[?x :a]
[?x :b])])
with the config:
(tufte/p :metric-name
(measured-code-here))
(d/q '[:find ?x :where
(or-join [?x]
[?x :a]
[?x :b])])#2022-01-2606:32robert-stuttafordwe have more such indentation rules, all applying the same basic rule to lots of forms - compojure, stuartsierra/component, guardrails, etc#2022-01-2606:33robert-stuttafordideally we'd maintain one cljfmt config with all of this, and have it in the repo with the code. we've done the same with clj-kondo stuff and it's fantastic#2022-01-2606:34cflemingSo in Cursive, he should customise the indentation for that form like this: https://cursive-ide.com/userguide/formatting.html#code-style-settings. As described there, he should set the config to “1”, which is one special parameter and the rest just indented.#2022-01-2606:35robert-stuttafordok, that's promising! and having that in source control?#2022-01-2606:36cflemingUnder Preferences | Editor | Code Style | Clojure, set the scheme to “Project”. That will create file in the .idea folder which contains that config for that project.#2022-01-2606:37robert-stuttafordok perfect. thanks Colin!#2022-01-2606:37cflemingNo worries. There’s a section in that doc about matching emacs too, in case there are other cases missing. If you have any other queries, let me know.#2022-01-2606:38robert-stuttafordwill do!#2022-01-2607:50cfleminghttps://twitter.com/CursiveIDE/status/1486244500666470401#2022-01-2612:35Dumchcan I propose some features for the new releases here?#2022-01-2612:39DumchI already havehttps://github.com/Liverm0r/dotfiles/commit/e514831dfdc115d530444874bc2f37bebae8cbc9#diff-2097776acc409b1c4c6a8ab45fd000f47833f462dae606f010ee7bfaa37b9444 locally, so implementing it won’t be hard.
Feature 1.
Idea actions for deleting/selecting a form.
Feature 2.
Idea action to comment out a form.
* form is one of "…", (…), {…}, […]#2022-01-2612:40DumchI need 1 to be able to have something like vim-sexp with idea-vim (an emacs users also can do this).
I’ve written here about the problem https://clojurians.slack.com/archives/C0744GXCJ/p1642500532023400#2022-01-2616:21imreTrying to check my code styles today after upgrading and it seems to be hanging:#2022-01-2616:22imreIntelliJ IDEA 2021.3.2 RC (Community Edition)
Build #IC-213.6777.38, built on January 25, 2022
Runtime version: 11.0.13+7-b1751.25 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.1
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 8
Registry:
scala.erase.compiler.process.jdk.once=false
Non-Bundled Plugins:
org.intellij.plugins.hcl (0.7.14)
net.seesharpsoft.intellij.plugins.csv (2.18.2)
name.kropp.intellij.makefile (213.5744.224)
de.thomasrosenau.diffplugin (2.1.8-imrekoszo)
com.namespace.sort.namespace-sort-plugin (1.7-imrekoszo-2021-3-linebreak)
com.jetbrains.plugins.ini4idea (213.5744.190)
org.jetbrains.kotlin (213-1.6.10-release-944-IJ6461.79)
org.jetbrains.idea.grammar (2021.1.2)
gherkin (213.6461.19)
dev.monogon.cuelang (0.8.3)
StringToolsPlugin (4.0)
String Manipulation (8.25.203.5981.1)
Key Promoter X (2021.3)
mobi.hsz.idea.gitignore (4.3.0)
com.cursiveclojure.cursive (1.12.2-eap2-2021.3)
com.github.shinichy.integrant (0.1.1)
com.github.brcosta.cljstuffplugin (0.5.2)
EDN-JSON Converter (0.0.5)
org.intellij.scala (2021.3.18)
Kotlin: 213-1.6.10-release-944-IJ6461.79#2022-01-2616:37imreoh, I'm just seeing this came up as an IDE error, reported as #23507#2022-01-2618:37seriogaHi @U0567Q30W, no plans for “Optimize imports” to remove unused imports?#2022-01-2621:17cfleming@U0HJNJWJH Yes, there’s a (potentially incomplete) to-do list in the release email, I’m hoping to get to it all over this EAP series.#2022-01-2616:44imreHmm interesting error I got at stub generation, perhaps it's to do with me using clojure 1.11.0-alpha4#2022-01-2616:46Alex Miller (Clojure team)definitely, clojure.core/abs is new in alpha4#2022-01-2616:47imreNot sure why it breaks stub gen though#2022-01-2616:48Alex Miller (Clojure team)the warning is correct and fine though (it's ok to overwrite the function)#2022-01-2616:48Alex Miller (Clojure team)yeah#2022-01-2616:48imreI'm getting used to seeing this warning all over the place now 🙂#2022-01-2616:50Alex Miller (Clojure team)issue out there for this already looks like https://github.com/dm3/clojure.java-time/issues/82#2022-01-2616:57imresent a pr there just in case#2022-01-2621:20cflemingThe stub generation currently assumes that anything output to stderr is an error. I could maybe relax that, but I’d have to ensure that I can be sure that the generation actually terminated correctly.#2022-02-1410:29cfleminghttps://github.com/cursive-ide/cursive/issues/2654#2022-01-2619:37wilkerluciohello, I was trying to find the setting to auto organize namespaces, but now when I go to the Clojure style part the screen never loads, it just stays in the state demonstrated by the screenshot#2022-01-2621:20imrehttps://clojurians.slack.com/archives/C0744GXCJ/p1643215029048700?thread_ts=1643183408.046300&cid=C0744GXCJ#2022-01-2621:21cflemingI’ll look at this today.#2022-01-2621:28cfleming@U066U8JQJ Are you seeing the same error? It’s an NPE in FormParameterCodeStylePanel.getPanel.#2022-01-2621:29wilkerlucioI got this error:
java.lang.RuntimeException: Unexpected value null
at cursive.formatter.codeStyle.FormParameterCodeStylePanel.<init>(CodeStyleConfig.kt:195)
at cursive.formatter.codeStyle.ClojureCodeStyleMainPanel.initTabs(CodeStyleConfig.kt:93)
at com.intellij.application.options.TabbedLanguageCodeStylePanel.ensureTabs(TabbedLanguageCodeStylePanel.java:163)
at com.intellij.application.options.TabbedLanguageCodeStylePanel.getPreviewText(TabbedLanguageCodeStylePanel.java:266)
at com.intellij.application.options.CodeStyleAbstractPanel.createEditor(CodeStyleAbstractPanel.java:144)
at com.intellij.application.options.CodeStyleAbstractPanel.<init>(CodeStyleAbstractPanel.java:105)
at com.intellij.application.options.TabbedLanguageCodeStylePanel.<init>(TabbedLanguageCodeStylePanel.java:68)
at cursive.formatter.codeStyle.ClojureCodeStyleMainPanel.<init>(CodeStyleConfig.kt:84)
at cursive.formatter.codeStyle.ClojureCodeStyleConfigurable.createPanel(CodeStyleConfig.kt:446)
at cursive.formatter.codeStyle.ClojureCodeStyleConfigurable.createPanel(CodeStyleConfig.kt:442)
at com.intellij.application.options.CodeStyleAbstractConfigurable.createComponent(CodeStyleAbstractConfigurable.java:36)
at com.intellij.application.options.codeStyle.NewCodeStyleSettingsPanel.<init>(NewCodeStyleSettingsPanel.java:32)
at com.intellij.ConfigurableFactory$createCodeStyleConfigurable$codeStyleConfigurableWrapper$1.createPanel(ConfigurableFactory.kt:32)
at com.intellij.application.options.codeStyle.CodeStyleMainPanel.ensurePanel(CodeStyleMainPanel.java:252)
at com.intellij.application.options.codeStyle.CodeStyleMainPanel.ensureCurrentPanel(CodeStyleMainPanel.java:237)
at com.intellij.application.options.codeStyle.CodeStyleMainPanel.highlightOptions(CodeStyleMainPanel.java:312)
at com.intellij.application.options.CodeStyleConfigurableWrapper.lambda$enableSearch$0(CodeStyleConfigurableWrapper.java:167)
at com.intellij.openapi.options.newEditor.SpotlightPainter.update(SpotlightPainter.java:75)
at com.intellij.openapi.options.newEditor.SettingsEditor$6.updateNow(SettingsEditor.java:272)
at com.intellij.openapi.options.newEditor.SettingsEditor.lambda$updateStatus$3(SettingsEditor.java:470)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:240)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:385)
at com.intellij.util.Alarm$Request.run(Alarm.java:374)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:220)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:348)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:131)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:187)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:760)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117)
at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
at java.desktop/java.awt.Dialog.show(Dialog.java:1070)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:701)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:437)
at com.intellij.openapi.ui.DialogWrapper.doShow(DialogWrapper.java:1671)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1629)
at com.intellij.ide.actions.ShowSettingsUtilImpl.showSettingsDialog(ShowSettingsUtilImpl.java:90)
at com.intellij.ide.actions.ShowSettingsAction.perform(ShowSettingsAction.java:50)
at com.intellij.ui.mac.MacOSApplicationProvider$Worker.lambda$initMacApplication$1(MacOSApplicationProvider.java:74)
at com.intellij.ui.mac.MacOSApplicationProvider$Worker.lambda$submit$8(MacOSApplicationProvider.java:172)
at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:214)
at com.intellij.openapi.application.TransactionGuardImpl.access$200(TransactionGuardImpl.java:21)
at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:196)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeLater$4(ApplicationImpl.java:348)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:131)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:187)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:891)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:760)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:492)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
#2022-01-2621:29cflemingHmm, that’s slightly different but seems related. Thanks, I’ll look at both.#2022-01-2622:55cflemingDoes restarting the IDE or just trying again work for either of you? This seems to be some weird constructor initialisation order problem, but I can’t figure it out.#2022-01-2623:29wilkerluciohere its consistently reproducible#2022-01-2623:31cflemingIt’s very strange, I can’t reproduce it at all. Can you email me your .idea/codeStyles/Project.xml file?#2022-01-2623:32cflemingIdeally after closing the project - not required to fully shut the IDE down though.#2022-01-2707:52cfleming@U08BJGV6E Could you do that too please? Also if you could include the system info from About IntelliJ IDEA that would be great too, so I can see which plugins you have in common. I’m starting to think this might be related to a plugin conflict.#2022-01-2708:05cflemingAlso, I’m interested to know if this happens for you in all projects, or just a specific one?#2022-01-2708:06imreAlso consistently reproable here. I don't even need to have a project open for it, same happens from the Idea launch page#2022-01-2708:06imreI posted my system info yesterday: https://clojurians.slack.com/archives/C0744GXCJ/p1643214178048500?thread_ts=1643183408.046300&cid=C0744GXCJ#2022-01-2708:36cflemingAh yes, thanks. That is super weird then, if it doesn’t even need a project.#2022-01-2708:36cflemingI’ll keep investigating.#2022-01-2708:36imrethank you!#2022-01-2714:15wilkerlucio@U0567Q30W just the delay, just tried to get my .idea/codeStyles/Project.xml but I can't find this file (looked at the project and at HOME)#2022-01-2714:17imreI also noticed that I don't seem to be able to save changes to my repl run configs#2022-01-2720:26cfleming@U08BJGV6E do you get an error?#2022-01-2720:27imreno, just the Apply button stays grey and if I click on Run my changes don't get picked up#2022-01-2720:27wilkerlucioin case it helpers, this is my system info:
IntelliJ IDEA 2021.3.1 (Ultimate Edition)
Build #IU-213.6461.79, built on December 28, 2021
Licensed to Wilker Lucio
Subscription is active until May 7, 2022.
Runtime version: 11.0.13+7-b1751.21 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.1
GC: G1 Young Generation, G1 Old Generation
Memory: 16384M
Cores: 16
Non-Bundled Plugins:
net.sf.opk.avro-schema-support (203.1.2)
net.seesharpsoft.intellij.plugins.csv (2.18.2)
me.ihxq.acejump.lite (1.2)
djblue.portal (0.20.1)
com.wakatime.intellij.plugin (13.1.8)
com.jetbrains.plugins.ini4idea (213.5744.190)
com.intellij.plugins.watcher (213.6461.19)
org.intellij.plugins.hcl (0.7.14)
org.jetbrains.plugins.hocon (2021.1.0)
com.intellij.apacheConfig (213.5744.190)
org.asciidoctor.intellij.asciidoc (0.36.13)
String Manipulation (8.25.203.5981.1)
PlantUML integration (5.10.0)
mobi.hsz.idea.gitignore (4.3.0)
com.cursiveclojure.cursive (1.12.2-eap2-2021.3)
com.github.shinichy.integrant (0.1.1)
mdx.js (1.0.213)
intellij.prettierJS (213.6461.6)
com.intellij.tailwindcss (213.6461.6)
com.intellij.lang.jsgraphql (3.1.2)
aws.toolkit (1.37-213)
com.dmarcotte.handlebars (213.5744.190)
Kotlin: 213-1.5.10-release-949-IJ6461.79#2022-01-2720:27cflemingHmm, that’s weird, I don’t think anything else has changed there. I’ll check.#2022-01-2720:31wilkerlucio@U0567Q30W is it weird that I can't find the xml config file? seems like its not getting generated here#2022-01-2720:35cfleming@U066U8JQJ Maybe, which files do you have in your .idea folder in your project? Also, does this happen in all projects for you? Does it also happen if you don’t have projects open like imre?#2022-01-2720:37wilkerluciojust tested:
1. closed IntelliJ
2. open intellij on the Welcome Screen
3. open settings from there
4. navigate to clojure code style#2022-01-2720:37wilkerluciothis still had the same issue#2022-01-2720:38cflemingOk, although the exception is slightly different, I think you’re both seeing the same thing somehow.#2022-01-2720:39wilkerluciomy .idea in a project#2022-01-2720:39cflemingThanks. So you have the Scheme under Code Style settings set to IDE, right?#2022-01-2720:40wilkerlucioyes, correct#2022-01-2720:46imreI also have it set to IDE and this is what I see under .idea in a project:#2022-01-2721:01cflemingInteresting, I wonder if that’s the problem, I’ll test that.#2022-01-2811:24cflemingHi guys, I have published a dev build, 1.12.2-dev1. Could you download it from here: https://plugins.jetbrains.com/plugin/8090-cursive/versions/dev and try it out? I’m pretty sure it will fix Wilker’s problem, and I hope it will fix Imre’s even though I don’t have a good explanation for it.#2022-01-2811:26imrecheers, gonna try now#2022-01-2811:27cflemingThere is still another problem I’m working on where the settings aren’t serialised properly, but I will have to try to finish that off tomorrow.#2022-01-2811:30imrenice, I can now load the clojure code style page on the welcome page#2022-01-2811:30imregot an error when I opened a project right after: #23569#2022-01-2811:31cflemingAh yeah, that’s just because it’s a dev build.#2022-01-2811:31cflemingI don’t think that should affect the other issue.#2022-01-2811:32imreI also checked editing the repl run config#2022-01-2811:32imreIt appears I can edit and the apply button works#2022-01-2811:32cflemingStill, that’s great news. I’m still not sure what the problem was, but it’s possibly related to Wilker’s problem (which was something else in the end.#2022-01-2811:32cflemingOh great!#2022-01-2811:33imreMy report yesterday probably wasn't complete: then I only tried to change the value of "allow parallel run" - and when that's the only change it still won't get applied#2022-01-2811:33cflemingWhat is not working at the moment is saving the config when you modify code style settings - I’m working with JetBrains on that. As soon as I get it fixed I’ll get this out.#2022-01-2811:33imrebut it does together with say changing display name#2022-01-2811:33cflemingHuh, interesting - I’ll check that out tomorrow too.#2022-01-2811:34imreThanks for the fix so far#2022-01-2811:34cflemingProbably just that field is missing from the list of things to check to see whether the editor has modified the config.#2022-01-2811:34cflemingNo worries, hopefully I can get the full thing out tomorrow.#2022-01-2811:35imre👍:skin-tone-3:#2022-01-2813:15wilkerlucioits back! 😄#2022-01-2821:23cflemingHooray!#2022-01-2821:50wilkerlucio@U0567Q30W one thing though, I just tried to see if my imports where getting auto-organized, but they are not, the option is checked, but they still getting always add to the end of the :require (simple require structure, no reader conditions or fancy things)#2022-01-2822:14cfleming@U066U8JQJ You’re talking about new ones being added by auto-require, right? Yes, that’s not there yet, it’s on the to-do list. What is new is that you can use the Optimise Imports action and it will sort out the ones that are there.#2022-01-2822:15wilkerlucioah, gotcha, thanks for the clarification#2022-01-2822:15cflemingSo you can run that right after an auto-require and it should put it in the right place.#2022-01-2703:40cflemingI’ve temporarily removed the eap2 update - some users have been experiencing problems with the code style migration, which I can’t figure out. Since that’s a non-reversible change, I’ve taken this down and will hopefully get a fixed version up shortly.#2022-01-2821:22cap10morganWhen I have cursive format some code, it always moves same-line comments far to the right (e.g. this: foo (:bar baz) ; barring the baz gives you foo becomes this: foo (:bar baz) ; barring the baz gives you foo). is that configurable? I want it to not do that 🙂#2022-01-2821:23cflemingYep, Preferences | Editor | Code Style | Clojure | General | Comment alignment column. Set it to 0 if you just want them left alone.#2022-01-2821:24dpsuttonI think there’s a (lisp) convention that ; aligns to the right and ;; aligns to the left correct?#2022-01-2821:26dpsuttonor i suppose ;;; aligns left, ;; aligns at the current indentation level, and ; aligns to the right?#2022-01-2821:28cflemingI’m not sure to be honest.#2022-01-2821:29cflemingI thought ;; was used for kind of like a ‘higher level’ comment about a block of code, which I guess would normally be at the left.#2022-01-2821:57nlessaHi @cfleming! Using Intellij-2021.3.1 Runtime version: 11.0.13+7-b1751.21 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. and Cursive 1.12.1-2021-3 I am always getting this exception when trying to use the shortcut for REpl-history.
clojure.lang.ArityException: Wrong number of args (2) passed to: cursive.repl.toolwindow/history-move
at clojure.lang.AFn.throwArity(AFn.java:429)
at clojure.lang.AFn.invoke(AFn.java:36)
at cursive.repl.actions$history_next.invokeStatic(actions.clj:542)
at cursive.repl.actions$history_next.invoke(actions.clj:539)
at clojure.lang.Var.invoke(Var.java:384)
at cursive.api.DelayedFn.invoke(DelayedFn.java:31)
at cursive.actions.ClojureActionBase.actionPerformed(ClojureActionBase.java:38)
at com.intellij.openapi.keymap.impl.ActionProcessor.performAction(ActionProcessor.java:65)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher$1.performAction(IdeKeyEventDispatcher.java:573)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.lambda$doPerformActionInner$10(IdeKeyEventDispatcher.java:706)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:265)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.doPerformActionInner(IdeKeyEventDispatcher.java:702)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:645)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processAction(IdeKeyEventDispatcher.java:584)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.processActionOrWaitSecondStroke(IdeKeyEventDispatcher.java:467)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.inInitState(IdeKeyEventDispatcher.java:456)
at com.intellij.openapi.keymap.impl.IdeKeyEventDispatcher.dispatchKeyEvent(IdeKeyEventDispatcher.java:224)
at com.intellij.ide.IdeEventQueue.dispatchKeyEvent(IdeEventQueue.java:804)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:754)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:447)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:818)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:446)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:805)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:498)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Anyone found this error before?#2022-01-2822:15cflemingYes, a few people have reported this. I haven’t managed to reproduce it, but there is a fix that I think will work in the next EAP.#2022-01-2823:29nlessaThanks, @cfleming!#2022-01-2822:30Drew Verleedoes cursive have step debugging features for cljs?#2022-01-2822:30cflemingNo, it doesn’t, sadly. It’s something I’d love to add and have spent a decent amount of time investigating, but it’s a lot of work.#2022-01-2822:32Drew Verleegotcha, yea. I'm no help there sadly. I'm just collecting information on if anything has support for it. I think the answer is no. I'm curious if somehow all the solutions can share a common set of features though in order get more mind share and hopefully support (financial, etc..).#2022-02-0100:41tony.kayThe source maps give you source-level debugging in the js console in Chrome.#2022-02-0100:41tony.kayin the sources tab#2022-02-0100:42tony.kayand exception breakpoints#2022-02-0100:42tony.kayit isn't perfect, but it isn't "nothing"#2022-01-2901:27cfleminghttps://twitter.com/CursiveIDE/status/1487235385415860225#2022-01-2902:55wilkerlucio@cfleming noticing something strange with indexing, in Pathom 3 I use guardrails to define functions with (>defn, it has a defn-like syntax and I tell Cursive to do that, but seems like its indexing some of the symbols, but not others, I did asked Cursive to define that as def instead, and then back again to defn, this fixed some of the cases, but after working a bit more I see not all were fixed#2022-01-2903:01wilkerlucioinvalidating caches didn't fixed it, but seems like using cljs.core/defn instead of clojure.core/defn made it work#2022-01-3022:17genekimSomewhere along the line, I picked up a habit of doing comment blocks like this:
(comment
{:a 1}
,) ; <--- note comma before closing paren
Someone noted that the comma would keep the closing paren from from being put right after the last form. I loved doing this because it made adding more forms inside the comment blocks super easy — no need to find that last closing paren, and insert a couple of newlines.
Cursive used to protect that last ,) during code auto-format. But I’m noticing that this is no longer the case? Is there a way to revert to the old behavior when formatting code?
Many thanks!!#2022-01-3022:19cflemingHmm, I’m not sure about that, I’ll take a look. One similar thing I do for parinfer is #_nil), which is uglier but should still work, I think.#2022-01-3106:37danierouxI do ())#2022-01-3109:04imreI never had to use any of those tricks, if I put the closing paren on its own line, Cursive leaves it alone... FWIW I use paredit, not parinfer#2022-01-3116:45genekimThank you @U0567Q30W and @U9E8C7QRJ — I’ll try to start using that! 🙏#2022-01-3119:18cfleming@U6VPZS1EK Do you use parinfer? As imre states, I suspect (but haven’t tested) that with paredit this wouldn’t be a problem. Is it possible that this started to affect you when you switched to parinfer?#2022-01-3119:19genekimAh, yes. I’ve used parinfer from the very beginning — in fact, to my knowledge, I never used anything else. (I needed all that extra help when I first started Clojure! 🙂#2022-01-3119:20genekimSo, to answer your question: I’m pretty sure the behavior changed. Perhaps when I upgraded Cursive versions? (I upgrade seldomly, so I could have jumped 1.5 years or more.)#2022-01-3119:21genekimHoly cow. I’m running 1.12.1-2021.2 — I thought I was a bit more current than that! Will upgrade very soon.#2022-01-3119:21cflemingHmm, I don’t think I’ve touched that code in forever, but I may be forgetting something - the older I get, the more it happens.#2022-01-3119:22genekim(Hmm. I guess I’m current, given my IntelliJ version: 2021-2.)#2022-01-3119:36cflemingYeah, 1.12.1 is current for Cursive, unless you’re taking EAPs.#2022-01-3112:07mathias_dwhi, does anyone know how to make this type of pop-up disappear?#2022-01-3112:28Dumchtry cmd+shift+a — show paramter hints#2022-01-3112:30Dumchyou need this window#2022-01-3112:59mathias_dwthanks for replying. That one seems to control the "useful" pop-ups, though. And I don't really mind getting the type of pop-up i showed, since often it's useful, but i often hides stuff I need to read, and i can't figure out how to make it go away without pressing esc.#2022-01-3113:08mathias_dwok, your tip showed me those are called parameter info popups. still no luck binding a key to close them, though...#2022-01-3114:23DumchI found out how to hide them with hotkeys without exiting input mode (have to add hotkey myself)#2022-02-0115:17mathias_dwcool, thanks a lot!#2022-02-0115:33mathias_dwjust in the unlikely case anyone else got annoyed by those popups: i ended up adding this in my .ideavimrc to use qq while in insert mode to get rid of the popup:
:inoremap qq <esc> :action TogglePopupHints<CR> i
#2022-01-3112:08mathias_dwnot using Escape, because I'm using ideavim, and that also gets me out of insert state#2022-01-3114:17dazldpossibly not a cursive question, but I think I have something turned on somewhere, and it’s letting me put the cursor anywhere in a file, instead of clamping to the existing whitespace. I prefer it when it jumps to the end of the whitespace - any ideas what it might be?#2022-01-3114:28Dumchmay it’s a virtual space you are talking about.#2022-01-3115:18Jordan RobinsonI've had this before, it was this: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206916285-Click-anywhere-and-cursor-is-put-there#2022-01-3115:19Jordan Robinson(column selection mode, towards the bottom of that link)#2022-01-3116:24dazlda thousand 🍪 to you both, you saved my sanity#2022-01-3116:24dazldthank you!#2022-01-3123:28hlshipWe've been moving from lein to deps; at first, this was great ... when deps changed, Cursive was much faster to update the project (again, giant mono-repo, with 45+ submodules). Now we've moving from Maven coords to Git coords for our many internal libraries, and it's gotten very slow to update. I know the Git coords are more work (it's also much slower when using clj), but is Cursive able to cache or parallelize things to speed it up?#2022-02-0111:48Jakub Holý (HolyJak)Is it possible to extend the test diff support to other assertions than (is (= expected actual)) ? Namely to https://cljdoc.org/d/com.github.seancorfield/expectations/ 's (expect expected actual) ?
In the terminal it is recommended to use expect with the humane-test-output lib but that does not work in Cursive REPL so I am curious what other options I have.
expect is a macro that eventually resolves into (clojure.test/is (=? expected actual)) (where the =? is just a symbol that clj.test understands)#2022-02-0120:57cflemingI would like to do this (I think Nubank have a similar lib) but it’s not possible at the moment.#2022-02-0114:55Dumchdo you know if there is a quick way to refactor one type of brackets into another (for example, from (..) to [..] )?#2022-02-0114:56imreyep, Cycle Collection Type ~or something like that~ is the name of the action#2022-02-0117:44Jakub Holý (HolyJak)Awesome! I had not idea that was possible. Thx!#2022-02-0118:53imreYW 🙂#2022-02-0116:48folconIs there a function that does its let bindings on the second argument? I'm trying to find an appropriate target for symbol resolution...
The below is getting a little annoying 😃...#2022-02-0116:51imredefn?#2022-02-0116:51imreor fn for that matter#2022-02-0116:51imrefn is probably better as it doesn't put anything into the global scope#2022-02-0119:21folconyep, not sure why that didn't occur to me 😳, thanks#2022-02-0119:22imredid it work? I haven't tried it#2022-02-0119:23imrealthough the binding form is different to that of a fn now that I look at it#2022-02-0119:53folconI went with defn in the end#2022-02-0119:53folconIt's "good enough" for now...#2022-02-0119:59folconThanks @U08BJGV6E 😃#2022-02-0120:25imrenm, glad I could help#2022-02-1906:47staypufdWhat UI lib are you using?#2022-02-2112:08folconhttps://github.com/HumbleUI/HumbleUI
It's already pretty good :)...#2022-04-1220:39staypufdThanks#2022-02-0214:58thhellerSo here is a weird question. I have https://github.com/thheller/shadow-experiments I've been working on for a long time now that I use in many different projects. Since I haven't done a proper release of that lib yet I just include it via :source-paths ["src/main" "../shadow-experiments/src/main"] in the projects (via lein)#2022-02-0220:32cflemingThat is definitely weird. I’m not sure whether that’s officially supposed to work, but that behaviour is definitely buggy. I’ll take a look.#2022-02-0215:01thhellersomehow that seems to confuse Cursive and I keep piling up .iml files. Dunno exactly when they appear but it might have something to do with leinigen refresh button
-rwxrwxrwx 1 thheller thheller 251 Mar 13 2021 shadow-experiments-1.iml*
-rwxrwxrwx 1 thheller thheller 251 Feb 14 2021 shadow-experiments-2.iml*
-rwxrwxrwx 1 thheller thheller 253 Jan 13 08:07 shadow-experiments-3.iml*
-rwxrwxrwx 1 thheller thheller 6334 Jan 10 18:28 shadow-experiments-4.iml*
-rwxrwxrwx 1 thheller thheller 253 Feb 2 15:56 shadow-experiments.iml*
#2022-02-0215:01thhellershould I just give up on this pattern? I realize its a hack but it is a workarround for lein checkouts having other issues 😛#2022-02-0215:04thhellerI don't mind the extra .iml files but sometimes in the project itself it sort of forgets about itself and all source paths and stuff are gone#2022-02-0215:04thhellerwhen I press the leiningen refresh button I think thats when it recreates a new iml file and basically recreates the project from scratch#2022-02-0215:05thhellerif this isn't supposed to work that is fine#2022-02-0215:20Jordan Robinsonthis may/may not help but another approach could be using a git reference in your project.clj#2022-02-0215:24Jordan Robinsonwe're using reifyhealth/lein-git-down for that#2022-02-0215:36thhelleryeah I was trying to avoid deps.edn or git 😉#2022-02-0215:45thhelleralso gets to kinda weird error messages when the project has been lost#2022-02-0215:45thhellerdunno where that 3c... prefix is coming from :P#2022-02-0215:49thhellernow it seems to be completely destroyed. even the lein refresh button doesn't get it back into a working shape#2022-02-0316:19p-himikI have two aliases with conflicting deps with versions that can't be compared (one has :mvn/version and the other has :git/sha). Enabling both of those aliases in Clojure Deps results in the Unable to compare versions error.
But I'd like to be able to work on code that needs the first alias and on code that needs the second one at the same time, without having to toggle them and refresh the deps every time I switch between files.
Is there a workaround that's not as clunky as creating a special alias just for Cursive that copies one of those aliases but excludes the dep with a conflicting version?#2022-02-0316:22imrehow about creating a third alias that just fixes a version of the conflicting dependency?#2022-02-0316:34p-himikThat makes sense, thanks!#2022-02-0416:10potetmFor some reason, test failures aren’t highlighting red for me now.#2022-02-0416:10potetmtbh this could have happened months ago — I’ve not run tests from the REPL for quite some time.#2022-02-0416:11potetmIs there a new option you’re supposed to turn on or something? Or maybe I accidentally turned it off at some point (if so, how do you turn it back on)?#2022-02-0416:14Jordan RobinsonI've had this for a few reasons:
• when the namespace has a _ when it should be a -
• when the name of the test file conflicts with another test file elsewhere
• when I can't attach to breakpoints in the file, which can be a few other things#2022-02-0416:21potetm@UC3B7UJF2 #2 it was (test ns was the same as the ns under test)#2022-02-0416:21potetmyou’re the man!#2022-02-0416:21Jordan Robinsonglad to help 🙂#2022-02-0420:30cflemingTIL - I didn’t know that!#2022-02-0709:52GGfpcNot sure if this already exists but I would love it if the watched variables in the debugger automatically doall-ed all the lazy seqs#2022-02-0722:41cflemingThe issue there is that they might be infinite. I agree it would be good if it could display them say 10 at a time, though.#2022-02-0800:26souenzzoit will create situations like
• code don't works
• open the debugger
• now the code works.
• close the debuger
• not work again #2022-02-0712:29imreI often find myself wanting to copy the fully-qualified name of a symbol or keyword these days. Is anyone aware of a command in Cursive to do that?#2022-02-0712:30imreso, standing on (defn as|df [] I would like my.namespace/asdf to get onto the clipboard.#2022-02-0712:31imrestanding on ::foo/qw|er I'd like :that.other.ns.foo/qwer to be copied#2022-02-0712:46Dumchset
#2022-02-0712:47Dumchand everything like w, b, e, vaw, yaw, * in normal mode will consider some-thing liek some-word/with.whatever as one word#2022-02-0712:49Dumchso copy will become yaw#2022-02-0713:25imreThat needs ideavim though, correct?#2022-02-0713:27Dumchoh, sorry, for some reason I though you were using ideavim 🙂#2022-02-0713:29imreThanks anyway.#2022-02-0713:30imreThe point is not that some expanded selection is copied, but that a fully qualified value is copied#2022-02-0713:32imreasdf -> my.namespace/asdf
::bleh -> :my.namespace/bleh
foo/bar -> that.other.ns.foo/bar
::foo/qwer -> :that.other.ns.foo/qwer#2022-02-0721:05cfleming@U08BJGV6E Right click | Copy/Paste Special… | Copy Reference#2022-02-0721:23apbleonardIn the past I have hit shift f6 (refactor > rename), which I use all the time anyway, to get the fully qualified name of a namespaced keyword at least.#2022-02-0721:27imrewonderful, thank you @U0567Q30W#2022-02-0814:03iecya@cfleming hi there, I have been suggested to ping you here about a problem I am having with cursive. Not sure how much detail you need, but I'll try to give you a bit of context: i'm working on a clojure project that also has some java files; when trying to start a local clojure repl it fails because it looks for a .class file in an absolute path saying it is not a relative path. More details, including the stack trace, should be included in the exception report #20491.
Interestingly, it works if i clone my repo in a tmp directory, but it doesn't work in my working directory within the root directory#2022-02-0814:19Jordan Robinsonpotentially related: https://github.com/cursive-ide/cursive/issues/2633
(no solution in there though, sorry)#2022-02-0815:41iecyathanks for sharing it @UC3B7UJF2
I actually found this github issue that is exactly what I am experiencing at the moment (still no answer though): https://github.com/cursive-ide/cursive/issues/2624#2022-02-0819:24GGfpcCan cursive highlight when you're passing the wrong type to a function based on fspecs?#2022-02-0900:13folconAnyone using clojure-extras with cursive, any way of turning off the red underlining? Cursive does a good job of unobtrusively highlighting stuff that's not resolved, I don't need telling twice...#2022-02-0900:16cflemingProbably best to ask that over in #clj-extras-plugin#2022-02-0900:27folconThanks!#2022-02-1009:25DumchIs there a way to ignore anything inside comment form (like in emacs)? I don’t want to see errors there#2022-02-1112:30souenzzoHey @UL05W6AEM
comment is a macro-level implementation of commentary blocks
it means that it's body needs to be readable my the clojure reader
Any syntax error inside a comment block will result in a exception while trying to load the namespace
with that in mind, i think that make sense the IDE warns you about syntax errors in this block#2022-02-1013:40roklenarcicDid anyone have luck with setting up build.clj in such a way that you could experiment with it in REPL? https://clojurians.slack.com/archives/C02B5GHQWP4/p1644498430343479?thread_ts=1644497861.646089&cid=C02B5GHQWP4#2022-02-1013:54R.A. PorterTry opening the Clojure Deps tool window, then expanding the Tool Alias folder. Check the build alias.#2022-02-1015:19roklenarcicYeah I did and I still get that message#2022-02-1115:33dvingothe build.clj file is just a suggestion, you can place it on your classpath - or under a separate directory like build and then add a deps alias that adds that dir to the classpath (as well as adding tools.build), this way you don't include the build code in your actual application code when it is built, but you can have the build available in cursive during development.#2022-02-1122:28cfleming@U66G3SGP5 Sorry, this is more awkward than it should be, I’ll try to fix it for the next build. I believe that you should be able to start a socket REPL in the terminal and connect to that using a remote REPL option in Cursive.#2022-02-1408:21roklenarcichm cool, but i’ve ran into a bigger problem. Even though I have build selected in Tool Aliases when I run the REPL, the dependencies from the build alias :deps key are absent from classpath.#2022-02-1410:22cflemingHmm, I’m not sure about that. I’ve filed this issue and will try to fix it soon: https://github.com/cursive-ide/cursive/issues/2653#2022-02-1017:08Grant HornerMinor gripe here (happy to make an issue or however you prefer to track these things). If I have a function that splits its arguments over multiple lines, I noticed that the signature when mousing over the function has some extra indentation. This isn’t something I usually do, but I’ve been experimenting with it since I’ve starting using inline specs with malli/schema-style defn , which get pretty long#2022-02-1122:28cflemingHmm, I see. Yeah, an issue would be good, thanks.#2022-02-1021:28James VickersAny idea how to debug what's happening with an error like this trying to run a lein profile? .idea.log just says:
2022-02-10 14:25:53,629 [85110763] INFO - xecution.runners.ExecutionUtil - Error running 'sponsor-repl':<br>Error executing Leiningen configuration.
com.intellij.execution.ExecutionException: Error executing Leiningen configuration.
at cursive.repl.runner.LocalConfiguration.createLeinParameters(ReplRunConfigurations.kt:516)
at cursive.repl.runner.LocalConfiguration.access$createLeinParameters(ReplRunConfigurations.kt:393)
...
#2022-02-1122:32cflemingIs there another exception following that one in the logs?#2022-02-1415:58James VickersI think this is the entire related part (based on time)
2022-02-11 17:05:15,298 [ 819856] INFO - xecution.runners.ExecutionUtil - Error running 'sponsor-repl':<br>Error executing Leiningen configuration.
com.intellij.execution.ExecutionException: Error executing Leiningen configuration.
at cursive.repl.runner.LocalConfiguration.createLeinParameters(ReplRunConfigurations.kt:516)
at cursive.repl.runner.LocalConfiguration.access$createLeinParameters(ReplRunConfigurations.kt:393)
at cursive.repl.runner.LocalConfiguration$getRunProfileState$1.createDeferredParameters(ReplRunConfigurations.kt:432)
at cursive.runner.DeferredCommandLineState.cacheDeferredParameters(Deferred.kt:72)
at cursive.runner.AbstractDeferredRunner$execute$1.run(Deferred.kt:104)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:436)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:120)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:496)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
2022-02-11 17:05:18,104 [ 822662] WARN - vdmanager.AvdManagerConnection - No Android SDK Found
#2022-02-1113:35Audriusparedit or parinfer? what to choose.#2022-02-1113:48Jordan RobinsonI like parinfer but it's definitely just a preference thing 🙂#2022-02-1113:57imreMy recommendation is paredit all the way.Clojure is my first lisp and my first functional programming language. Back in '14 when I started playing with Clojure and Cursive, it was an absolute heureka moment when I read the Cursive paredit docs.
Paredit made it incredibly easy to work with an otherwise unknown language and I totally miss it from every language where it isn't available.
slurp, barf, raise, splice, etc are absolutely essential to my toolbox ever since.
It makes you understand the AST of your code while being completely decoupled from how you indent/lay out things.#2022-02-1122:29cflemingPersonally I use parinfer, since I can also use the paredit commands when they make sense.#2022-02-1116:00CaseyIs there a way to get the clj formatter to suck up the trailing closing parens on their own line? I don't see a paren-affecting setting in the code style settings panel#2022-02-1122:29cflemingIt should do this by default, do you have a case where that’s not working?#2022-02-1612:54CaseyHmm it's definitely not. On any clojure project/file.#2022-02-1612:54CaseyIt's possible this is user error as this is a long time cursive install, and I might have broke a setting in the past. Is there an option for this?#2022-02-1116:19GGfpcIs it possible to define custom resolvers for macros? I'd like to use orchestra's defn-spec without all my code being red and squiggly 😅#2022-02-1116:30Dumchdo you know that if you press alt+enter on a macro form, Idea will ask you to select what kind of syntax to use for it?#2022-02-1116:39Dumchhttps://cursive-ide.com/userguide/macros.html#2022-02-1116:41GGfpcYes, but this one can't be resolved as any of the existing ones#2022-02-1122:31cfleming@U016XBH746B Could you add an issue for that and I’ll look at adding support, since orchestra is pretty popular.#2022-02-1215:59steffanI'm having trouble getting going with Babashka support in Cursive 1.12.2-eap3-2021.3. Following the guide at https://cursive-ide.com/userguide/babashka.html I've added the Babashka facet to the only module in a barebones deps.edn based project, but I notice the External Library node its added is empty, which doesn't match the screenshots in the guide. When I mark any file as a Babashka script, all forms show as unresolved. Possibly related, Cursive didn't find my bb installation, so I had to type in the "path to bb cmd" when adding the facet: /home/linuxbrew/.linuxbrew/bin/bb#2022-02-1221:08cflemingI found that adding the deps to the external library was a bit flakey (it’s an IntelliJ problem, I think), but that closing and reopening the project usually fixed it. Does that help your case?#2022-02-1300:20steffanSadly no, closing and re-opening the project brings no improvement. I've tried adding the Babashka facet in various projects but all exhibit the same issue, where the "Babashka" External Library node is shown but appears empty. Cursive is totally happy with all my regular deps.edn Clojure projects, so I'm sure the deps part is configured and working OK in my Cursive setup. Is perhaps Cursive unhappy with my bb installation? I installed bb using the Linux version of brew.#2022-02-1300:23cflemingOn the command line, if you do bb print-deps --format deps what does that show?#2022-02-1300:24steffan❯ bb print-deps --format deps
{:deps
{selmer/selmer {:mvn/version "1.12.44"},
org.clojure/clojure {:mvn/version "1.11.0-alpha4"},
org.clojure/tools.logging {:mvn/version "1.1.0"},
org.clojure/tools.cli {:mvn/version "1.0.206"},
rewrite-clj/rewrite-clj {:mvn/version "1.0.699-alpha"},
babashka/babashka.core
{:git/url "",
:git/sha "52a6037bd4b632bffffb04394fb4efd0cdab6b1e"},
hiccup/hiccup {:mvn/version "2.0.0-alpha2"},
org.clojure/data.xml {:mvn/version "0.2.0-alpha6"},
org.clojure/data.csv {:mvn/version "1.0.0"},
com.taoensso/timbre {:mvn/version "5.1.2"},
com.cognitect/transit-clj {:mvn/version "1.0.324"},
babashka/babashka.curl {:mvn/version "0.1.1"},
clj-commons/clj-yaml {:mvn/version "0.7.107"},
cheshire/cheshire {:mvn/version "5.10.2"},
org.clojure/core.match {:mvn/version "1.0.0"},
org.clojure/test.check {:mvn/version "1.1.1"},
babashka/fs {:mvn/version "0.1.2"},
nrepl/bencode {:mvn/version "1.1.0"},
org.clojure/core.async {:mvn/version "1.5.648"},
http-kit/http-kit {:mvn/version "2.5.3"}},
:paths ["scripts"]}#2022-02-1300:28steffanAlso, in case it helps:
❯ cat bb.edn
{:paths ["scripts"]}
❯ cat deps.edn
{:paths ["src"]
:deps {org.clojure/clojure {:mvn/version "1.10.3"}}}#2022-02-1301:15cflemingThanks, I’ll try to repro that.#2022-02-1307:12cfleminghttps://twitter.com/CursiveIDE/status/1492757978784878597#2022-02-1308:03imreThat's good stuff. Will there also be an option to add a linebreaks after :require and :import? Or is there one already?#2022-02-1321:40cflemingThere isn’t at the moment, no - currently Cursive never touches linebreaks. I’m planning to revamp all the formatting shortly which will make all that more configurable. What exactly do you want to happen there, just to be clear?#2022-02-1406:52imremy preference is exactly how it's in the summary at https://stuartsierra.com/2016/clojure-how-to-ns.html - one linebreak after :require and :import#2022-02-1406:55imreThat also seems to be the direction cider's refactor-nrepl adopted in 3.x: https://github.com/clojure-emacs/refactor-nrepl/blob/master/CHANGELOG.md#310-2021-11-09#2022-02-1406:56imreHaving this formatting/organization happen automatically on requiring/importing something would also be good to have#2022-02-1406:58imreHowever, for me it would be important to be able to turn auto-formatting and adding newlines off for specific projects. Normally when I submit a patch to a 3rd party project, I want to make the least amount of changes. However for our internal ones where I'm (partially) in control of formatting I'll want to clean stuff up as I go.#2022-02-1409:07cflemingSure, when adding new namespaces and imports, Cursive always adds a newline at the moment. If you have two in the same line though, it won’t insert a newline when formatting.#2022-02-1409:07cflemingRight now there isn’t a global “don’t do anything” switch, I’ll add one for that use case.#2022-02-1409:08cflemingAnd yes, once this is all done and working, it will allow me to finally add things like moving stuff between namespaces, proper namespace renames, etc.#2022-02-1409:42imre🎉#2022-02-1409:42imrekeep going Colin#2022-02-1506:35cflemingI was thinking about the global disable switch, and I don’t think it’s actually required. Right now, the ns will only be modified when you invoke the Optimise Imports action. The only place that would happen automatically is if you had configured it to happen on format, on commit, or maybe some other places that IntelliJ lets you invoke it automatically. So I’m assuming that for other people’s projects, you just wouldn’t configure that, and wouldn’t invoke the action.#2022-02-1506:37cflemingWhat I’m planning to do for the require insertion on completion is to scan through the requires, and insert the new clause before the first one that is lexicographically greater than the new one. So if your clauses are in order that should be maintained, and if they’re not you’re no worse off than you are now.#2022-02-1506:41cflemingFor some operations like moving things from one namespace to another, the Optimise operation will probably be invoked automatically by default on the namespace you’re moving things from, to tidy it up, and at that point it will probably make sense to have a “don’t do that” switch, even though I suspect that you will still want it in most cases anyway.#2022-02-1416:17Daniel ShrikiHi everyone. does anybody has a solution: project created from polylith - when I’m adding dependencies to deps.edn - intellij pops a message to import the new dependencies - however when I do so - he doesnt show the imported libs under ‘external libraries’ and it has not been added to ‘projectname.iml’ file. also, when I look at the project structure I see that he didn’t create dependencies in the module - so as a consequence I cant use the dependency in the code#2022-02-1418:07Daniel Shrikia solution has been found. tnx.#2022-02-1513:28imreIt appears #_ doesn't work fully correctly with type hints, not sure if this had already been reported? I can create an issue if not. In the attached screenshot, [chan] should also be highlighted as commented out#2022-02-1513:32emccueI think this is correct behavior. As edn it is read literally as
* the symbol ^ActionListener
* a vector containing
* the symbol chan
The #_ signals to the edn reader to discard the next form, which is the symbol ^ActionListener.
All this happens before clojure has a chance / wants to add special interpretation to the symbol/vector pair#2022-02-1513:34emccueaaaand nope, nvm I am exactly wrong#2022-02-1513:34Alex Miller (Clojure team)The discard is discarding the thing after the type hint here#2022-02-1513:35Alex Miller (Clojure team)That is, it does not mean what you think it means#2022-02-1513:37imreDoes the discard also discard the type hint or only what comes after it? My expectation is that it discards both#2022-02-1513:38imreAnd that Cursive should highlight both as discarded#2022-02-1513:38emccueHuh, thats probably a bug in clojure.edn then
(require '[clojure.edn :as edn])
=> nil
(edn/read-string "#_ ^a [3]")
=> nil
#2022-02-1513:38emccuesince afaik metadata isn't part of the EDN spec, so this is clojure specific behavior#2022-02-1513:45Alex Miller (Clojure team)The Clojure edn reader supports some extensions beyond the spec #2022-02-1513:46Alex Miller (Clojure team)re the question above, it discards the next read value, which in this case is a vector with meta#2022-02-1513:47imre@U0567Q30W are you aware of a related open issue?#2022-02-1519:19cflemingNo, I’m not - an issue would be great, thanks.#2022-02-1519:21cflemingDoes that mean that #_ ^:foo bar baz would return baz without meta, or that the meta would apply to bar and would get dropped?#2022-02-1519:22Alex Miller (Clojure team)those sound like the same thing :)#2022-02-1519:22Alex Miller (Clojure team)the meta would be attached to bar, and bar would be discarded, and you would get baz with no meta#2022-02-1519:23cflemingIn my defence, it’s 8am here, and I should be doing other things rather than replying to Slack without thinking properly 🙂#2022-02-1519:23Alex Miller (Clojure team)I hear ya :)#2022-02-1519:24Alex Miller (Clojure team)the key is, it's a stack#2022-02-1519:25Alex Miller (Clojure team)#_ says read the next thing and drop it
^:foo says here's some meta, read the next thing and give it that meta
read bar symbol
... meta is applied to bar
... #_ drops bar w/meta
read baz symbol#2022-02-1519:26Alex Miller (Clojure team)(the stack being actual stack frames in the LispReader, not an explicit stack)#2022-02-1519:34cflemingRight, that makes sense, thanks. So I guess ^:foo #_ bar baz would leave baz with meta applied.#2022-02-1519:48imreI think that's correct. Probably also important to repeat that the current behaviour is expected in edn. I'll record an issue#2022-02-1519:51imrehmm now I'm unsure about that edn part#2022-02-1519:52imre(clojure.edn/read-string "[^asdf foo]")
=> [foo]
(clojure.edn/read-string "[#_^asdf foo]")
=> []
#2022-02-1520:06imreoh yeah, that's the https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/EdnReader.java#L53 Alex mentioned#2022-02-1520:22imrehttps://github.com/cursive-ide/cursive/issues/2656#2022-02-1620:50souenzzohttps://clojurians.slack.com/archives/C0744GXCJ/p1639748950418800#2022-02-1906:35staypufdAlex Miller said above: “the meta would be attached to bar, and bar would be discarded, and you would get baz with no meta”#2022-02-1906:37staypufdSo I'm confused. Colin's says that baz would have the meta, Alex said it wouldn't. #2022-02-1906:37staypufdGonna try in REPL#2022-02-1921:01cflemingAlex is definitely correct here.#2022-02-1513:32Jakub Holý (HolyJak)Hm, "Edit REPL Commands" allows me to change/delete but not to add a command (nor it points to where I could add one)?!#2022-02-1513:40imrehttps://github.com/cursive-ide/cursive/issues/1415#2022-02-1513:58Jakub Holý (HolyJak)Ah, thanks! I should have thought of checking that first.#2022-02-1514:42AudriusIs there a way to get symbol information from REPL rather the setting everything manually as documentation says?
I have Macro heavy code with a lot of unresolvable vars.#2022-02-1514:54imreNot at the moment as far as I know#2022-02-1523:30cflemingNo, Cursive doesn’t support this. It will in the future support customisation for macro forms, but doesn’t do that yet.#2022-02-1520:22imrehttps://github.com/cursive-ide/cursive/issues/2656#2022-02-1602:36steveb8nQ: I’m often editing edn or clojure files and need to insert a uuid. I jump to the repl and call (UUID/randomUUID) then copy and paste. Could Cursive automate this so I can have a keybinding that inserts a fresh uuid at the cursor location?#2022-02-1613:23Andrewhow about a REPL command similar to this, with a keybinding assigned?#2022-02-1623:26cflemingNice solution! I’m also planning to allow REPL commands to insert the results in the editor, which would make that even slicker.#2022-02-1721:56steveb8nThanks! I never would have figured that out. works great. will look forward to that new feature @U0567Q30W so that it’s 1 keystroke instead of 2#2022-10-2919:47cjsauerVery late to this thread but there is also this plugin: https://plugins.jetbrains.com/plugin/8320-uuid-generator#2022-11-1602:48onetomalso, there is a /usr/bin/uuidgen on macOS by default.
then u can also pipe it into pbcopy, if u want it on the clipboard (or as macOS calls it, Paste Board, hence *pb*copy)
so u can have some shell command runner plugin, which does this on a keystroke.
i usually just run such stuff from the built-in terminal (which i've bound to Cmd-2)
i do miss the ability to copy the last REPL evaluation result into the clipboard though...
that would be a great, reusable action!#2022-02-1610:50GGfpcDoes cursive support inspecting data inside threaded macros or is adding a let the only way to see the intermediate state?#2022-02-1610:53imreI'm not aware of a built-in way, but it would be nice#2022-02-1610:54imreI usually do a tap thing in this case btw, like (-> foo :bar (doto tap>) :baz)#2022-02-1623:26cflemingThere’s no built-in solution for this at the moment, sorry.#2022-11-1602:56onetomthere is https://github.com/philoskim/debux, which works on clojurescript too, but it's a bit too heavy-weight for my taste, so i've resorted to
1. have a live template definition, which types this for me: [our.company.common :refer :all]
2. then i add this to most of our NS forms
3. i defined a ? function, which pretty-prints any value (with puget.printer/cprint) and also returns it, so i can just drop it into threading forms
i've originally called it probe, but ? doesn't seem to collide with anything so far and it's far easier to add and remove.
it really feels akin to probing an electrical circuit with a multi-meter.#2022-11-1602:58onetomthis is the source code:
(defn probe
([x]
;; Print info about call-site
(let [[_this-invokeStatic _this-invoke call-site]
(-> (ex-info "" {}) .getStackTrace)]
(println)
(println "=== PROBE ===")
(println " at" (.toString call-site)))
(pp x)
x)
([xform x]
(probe (xform x))
x))
i use that stack trace trickery to
1. ignore the stackelement of the probe function itself
2. print the top-most, relevant stack element in a format, which cursive can turn into a link in the REPL window
that way i know where my probes are and quickly get to them, if i want to remove them.#2022-11-1602:59onetompp is just a little automation around picking between clojure.pprint and puget.printer:
(defmacro >stderr [& body] `(binding [*out* *err*]
#2022-02-1617:36kwladykaava.lang.Throwable: Error handling response
java.lang.IndexOutOfBoundsException: Wrong line: 523. Available lines count: 100
at com.intellij.openapi.editor.impl.LineSet.checkLineIndex (LineSet.java:200)
com.intellij.openapi.editor.impl.LineSet.getLineStart (LineSet.java:181)
com.intellij.openapi.editor.impl.DocumentImpl.getLineStartOffset (DocumentImpl.java:1017)
cursive.testing.actions$annotate_test$reify__17591.compute (actions.clj:102)
com.intellij.openapi.application.impl.ApplicationImpl.runReadAction (ApplicationImpl.java:841)
cursive.testing.actions$annotate_test.invokeStatic (actions.clj:99)
cursive.testing.actions$annotate_test.invoke (actions.clj:97)
cursive.testing.actions$fn__17692.invokeStatic (actions.clj:219)
cursive.testing.actions/fn (actions.clj:215)
clojure.lang.MultiFn.invoke (MultiFn.java:229)
cursive.testing.actions$test_handler$process__17725.invoke (actions.clj:298)
cursive.testing.actions$test_handler$reify__17728.out (actions.clj:310)
cursive.repl.nrepl$handler.invokeStatic (nrepl.clj:78)
cursive.repl.nrepl$handler.invoke (nrepl.clj:61)
cursive.repl.nrepl$start$reify__14845$fn__14853.invoke (nrepl.clj:141)
cursive.repl.nrepl$start$reify__14845.run (nrepl.clj:140)
com.intellij.openapi.application.impl.ApplicationImpl$1.run (ApplicationImpl.java:265)
java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:515)
java.util.concurrent.FutureTask.run (FutureTask.java:264)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run (Executors.java:668)
java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run (Executors.java:665)
java.security.AccessController.doPrivileged (AccessController.java:-2)
java.util.concurrent.Executors$PrivilegedThreadFactory$1.run (Executors.java:665)
java.lang.Thread.run (Thread.java:829)
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
at cursive.logging$do_error.invokeStatic(logging.clj:60)
at cursive.logging$do_error.invoke(logging.clj:59)
at cursive.logging$do_log.invokeStatic(logging.clj:45)
at cursive.logging$do_log.doInvoke(logging.clj:38)
at clojure.lang.RestFn.invoke(RestFn.java:464)
at cursive.repl$print_exception.invokeStatic(repl.clj:152)
at cursive.repl$print_exception.invoke(repl.clj:150)
at cursive.repl.nrepl$start$reify__14845$fn__14853.invoke(nrepl.clj:143)
at cursive.repl.nrepl$start$reify__14845.run(nrepl.clj:140)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:265)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
Unfortunately I can’t paste tests.#2022-02-1623:27cflemingDoes the name of your test file conflict with another test file in your project?#2022-02-1713:18kwladykano, at least I didn’t catch any#2022-02-1713:59kwladykabut wait, probably you were right. I removed some extra code for debugging purpose and not I don’t have this errror#2022-02-1713:59kwladykathis is huge code base old project#2022-02-1713:59kwladykathank you!#2022-02-1617:38kwladykatests work if run not in cursive#2022-02-1617:39kwladykaalthough it works on another developer computer which use cursive too. I have the newest intellij and cursive stable version#2022-02-1617:40kwladykait is happening in 1 ns, for the specific code, but it is very regular simple code without nothing special.#2022-02-1620:22souenzzoAnyone using cursive in a remote setup?
Do REPL's run at local or at remote machine?
https://www.jetbrains.com/help/idea/remote-development-starting-page.html#2022-02-1623:27cflemingI don’t do this myself, but I’m also interested to know if anyone has tried this, and how well it worked.#2022-02-1702:01souenzzointellij/idea remote still do not work. tried via local network (wired) and it is too slow.#2022-02-1702:01souenzzoI was not able to enable cursive plugin#2022-02-1702:01souenzzo(because it is too slow)#2022-02-1712:21souenzzoOk @U0567Q30W, now in a fresh morning I did new tests:
• Remote intellij works in small projects
• I created a new file: deps.edn, it offers to install cursive. Accept & restart
• After restart, even simple operations like show files in the project now are too slow/do not work
• If i keep trying to use intellij (open menus, reboot ide, etc), it somehow autodisable cursive
#2022-02-1712:21souenzzoI would like to send you some logs but I didn't understand where is the logs. The one that I found is from the client, that feels useless.#2022-02-1712:22souenzzoTLDR; you will need to explicitly support remote intellij 😕#2022-02-1712:24souenzzohttps://gist.github.com/souenzzo/ea9ed96ee539ec6d004a840cb7bbe816#2022-02-1712:25souenzzo#2022-02-1712:26souenzzo2022-02-17 09:24:42,106 [ 419019] INFO - e.plugins.DisabledPluginsState - Plugins to disable: [com.cursiveclojure.cursive] #2022-02-1700:36lspectorI have a student whose new IntelliJ/Cursive setup allows him to create a new leiningen project, start a REPL, and evaluate expressions, but all of the symbols in his core.clj are highlighed and there's a message saying that they can't be resolved, or something like that. Also, the auto-indenting doesn't seem to know it's Clojure code, and there is an error message somewhere about a missing python dependency. I'm sorry for the fuzzy details here, but I'm not in front of his machine now.... but is this enough to ring a bell for anyone that might give a hint of what I should tell him to try?#2022-02-1701:17cflemingDoes anything here help? https://cursive-ide.com/userguide/troubleshooting.html#help-lots-of-symbols-don-t-resolve#2022-02-1701:44salamhey, Colin. i’ve been getting this NPE (“Got unexpected exception during formatting ClojureFile”) a lot when editing CLJS files which have namespaces requires as strings (e.g., ["react" :as react]) since i upgraded Cursive to 1.12.2-eap4. judging from the following line, it appears to have something to do with the new Optimize Requires/Imports code:
at cursive.inspections.list.ClUnusedRequire.invoke(ListInspections.kt:31)#2022-02-1721:55cflemingThanks, I’ll get that fixed.#2022-02-1707:16jaimeHi, on the title bar, only the last part of the namespace is showing in full s.s.d.views , is there a way to show the full namespace by default?#2022-02-1712:32manutter51Look in Preferences under Languages & Frameworks -> Clojure. The last item under Appearance Options is Editor Tab Style, which will abbreviate namespaces if you select Truncated Namespace, so try one of the other two options.#2022-02-1720:34jaimeAwesome, that did the trick. Thanks a lot!#2022-02-1712:36manutter51By the way, I have my tabs on the right instead of at the top (Preferences -> Editor -> General -> Editor Tabs -> Tab Placement). Better use of space IMO, plus you get more control over the width of the tabs.#2022-02-1720:35jaimeOh nice tip. I don't show tab and nav toolbar though 😅#2022-02-1716:08emccueIDK the right place to ask this, but how can i make a REPL configuration "do what is in my zshrc"#2022-02-1716:09emccueexport PATH=~/.nix-profile/bin:$PATH
nix-shell ~/system/shell.nix
source ~/.lumanu
#2022-02-1716:10emccuewant to source all those environment variables and if possible run within the nix-shell#2022-02-1717:04AJ Jaro@U3JH98J4R Would configuring a Before Launch action that runs an External Tool work for this?#2022-02-1717:04emccueDoes not seem to since source is not an actual program#2022-02-1907:24staypufdCan you use “.” As it is an alias for source… ?
#2022-02-1716:18bennyhello, I’m trying to open a gradle project and my source root (src/main/clojure) is not being recognized and I can’t add it via the IntelliJ notification. I continue to get an IDE error:
java.lang.NullPointerException
at cursive.notifications.SourceRootNotificationProvider$AddSourceRoot.lambda$run$0(SourceRootNotificationProvider.java:119)
at com.intellij.openapi.roots.ModuleRootModificationUtil.lambda$updateModel$9(ModuleRootModificationUtil.java:135)
at com.intellij.openapi.roots.ModuleRootModificationUtil.modifyModel(ModuleRootModificationUtil.java:143)
at com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel(ModuleRootModificationUtil.java:134)
at cursive.notifications.SourceRootNotificationProvider$AddSourceRoot.run(SourceRootNotificationProvider.java:116)
...#2022-02-1901:13salami don’t think Cursive supports Gradle or even Maven.#2022-02-1716:26bennylooks like my problem might be that my version of gradle (7.x) is not supported#2022-02-1716:32bennyswitched to https://github.com/clojurephant/clojurephant/releases/tag/0.7.0-alpha.1 and it still fails 😕#2022-02-1717:37Ernesto GarciaHi all. I’m having an issue with a Leiningen project that includes Java source files through
:java-source-paths ["src-java"]
When I try to run a configuration that relies on Leiningen to run, I am getting the following IDE error: “Error running ‘REPL dev-site’: Error executing Leiningen configuration.”#2022-02-1717:38Ernesto GarciaIt seems that Leiningen is not finding Java Runtime, from idea.log
2022-02-17 18:14:14,069 [188710431] DEBUG - #cursive.deps.DepsShimProvider - Executing deps via CLI, uberjar at /usr/local/Cellar/clojure/1.10.3.822/libexec/clojure-tools-1.10.3.822.jar
2022-02-17 18:14:16,063 [188712425] DEBUG - #cursive.shim.Shim - Creating shim:
Namespaces cursive.leiningen.init, cursive.leiningen.project
Version 2.9.3
Files /Users/ernesto-reify/.lein/self-installs/leiningen-2.9.3-standalone.jar
2022-02-17 18:14:16,063 [188712425] DEBUG - #cursive.shim.Shim - Shim URLs: file:/Users/ernesto-reify/Library/Application%20Support/JetBrains/IdeaIC2021.3/plugins/clojure-plugin/lib/shimdandy-impl-1.2.1.jar, file:/Users/ernesto-reify/Library/Application%20Support/JetBrains/IdeaIC2021.3/plugins/clojure-plugin/lib/cursive-lein-shim.jar, file:/Users/ernesto-reify/.lein/self-installs/leiningen-2.9.3-standalone.jar
2022-02-17 18:14:16,336 [188712698] DEBUG - #cursive.deps.DepsShimProvider - Executing deps via CLI, uberjar at /usr/local/Cellar/clojure/1.10.3.822/libexec/clojure-tools-1.10.3.822.jar
2022-02-17 18:14:20,389 [188716751] INFO - STDERR - The operation couldn't be completed. Unable to locate a Java Runtime.
2022-02-17 18:14:20,389 [188716751] INFO - STDERR - Please visit for information on installing Java.
2022-02-17 18:14:20,389 [188716751] INFO - STDERR -
2022-02-17 18:14:20,394 [188716756] WARN - #cursive.shim.IndicatorBridge - Exit called in Leiningen:
java.lang.RuntimeException: null
at cursive.leiningen.project$add_standard_hooks_BANG_$fn__2318$fn__2319.invoke (project.clj:515)
cursive.leiningen.project$add_standard_hooks_BANG_$fn__2318.doInvoke (project.clj:515)
clojure.lang.RestFn.applyTo (RestFn.java:139)
clojure.core$apply.invokeStatic (core.clj:667)
clojure.core$apply.invoke (core.clj:660)#2022-02-2020:28Mario AngstHi all! I am new to Clojurescript, coming from an R/ Python background. As a long-time PyCharm user I was delighted to find Cursive 🙂 ! Currently working through http://learn-clojurescript.com. I quite like Clojure up until now 🙂!
Clojurescript seems to be set up correctly, I can run basically everything up until now from the command line and editing files within IntelliJ. However, I cannot get Cursive to work in a deps.edn project setting. I constantly keep getting the error
Could not create shim: Could not create shim
(stacktrace attached below). I'm IntelliJ IDEA Ultimate 2021.3.2. Cursive is the latest non EA-version.
I've tried
• downgrading both IntelliJ and the plugin
• re-installing IntelliJ while clearing the Cache
• running from both Windows and WSL2 (how cool is that by the way)
• different SDKs (SDK 11, Temurin,
• after finding an earlier thread in here changing something in the Deps setting and hitting apply, does not do anything neither
I'd be super grateful for a pointer! Tried other IDEs, but VS Code/ Calva confuses me (though seems to work). Really want to get Cursive to work.#2022-02-2020:36Mario Angststacktrace:#2022-02-2100:26cflemingI was just looking at this yesterday. Does upgrading tools.deps on the command line help? To prompt Cursive to pick that up, you might need to go to Preferences | Build, Execution, Deployment | Build Tools | Clojure Deps, let it report the version and then hit apply.#2022-02-2108:30Mario Angst@U0567Q30W thanks for looking into this! I upgraded tools.deps.alpha to 0.12.1148 (still new to this but added it to my user.depn and hit clj on the command line and it upgraded) and as you said, when I went to the ... | Clojure Deps menu, the version appeared.
Error sadly persists, stacktrace has also not changed 😞#2022-02-2108:51cfleming@U0349822389 Can you try this, please?
1. Open Help->Diagnostic Tools->Debug Log Settings.
2. In the box that’s opened, enter #cursive.deps.DepsShimProvider and press Ok.
3. Reproduce the problem.
4. Check your log file from Help->Show log in Finder/Explorer for lines mentioning DepsShimProvider, and let me know what they say.#2022-02-2108:52cflemingYou should either see a path to an uberjar, or a list of files making up a classpath, probably in your Maven repo.#2022-02-2108:56cfleming@U064X3EF3 Assuming the log entries show Mario using the correct version, any other ideas why this might be happening? This is problem we discussed the other day, but the assumption that the user’s version of deps CLI is out of date looks like it might not be the case.#2022-02-2109:56Mario Angst@U0567Q30W Ok, I've done this. As you said, the line shows a (long) list of files making up the classpath. Start of the latest entry:
2022-02-21 10:51:21,482 [ 23976] DEBUG - #cursive.deps.DepsShimProvider - Executing deps 0.12.1148 directly, classpath C:\Users\Mario\.m2\repository\org\clojure\tools.deps.alpha\0.12.1148\tools.deps.alpha-0.12.1148.jar:C:\Users\Mario\.m2\repository\org\apache\maven\resolver\maven-resolver-api\1.6.3\maven-resolver-api-1.6.3.jar:C:\Users\Mario\.m2\repository\org\ap (...)
As far as I can tell, it's using the correct version?#2022-02-2113:43Alex Miller (Clojure team)The error is about missing stuff from Clojure 1.10 - can you see what version of Clojure is on that classpath?#2022-02-2115:17Mario AngstIt looks like the version on the classpath is clojure-1.9.0.jar - I am a bit confused because my user deps.edn and my project deps.edn include 1.10.3 (that's also what calling clj in the terminal yields)#2022-02-2115:23Alex Miller (Clojure team)really a question for @U0567Q30W - I don't know how all that shim stuff works. tools.deps.alpha 0.12.1148 depends on Clojure 1.10.3, so not sure how that classpath is being made#2022-02-2115:26Mario AngstThanks - it's a hint. As a hail mary, I've also tried manually deleting the 1.9.0 folder from the maven repository, but then setting the latest clojure deps version in ... | Clojure Deps downloads it again#2022-02-2115:56Mario Angstwhat is interesting is that if I delete 1.9.0 and then launch a fresh project with deps.edn set to the default
{:deps {org.clojure/clojurescript {:mvn/version "1.10.520"}}}
I get an error
Cannot execute - downloaded deps classpath not found:
C:\Users\Mario\.m2\repository\org\clojure\clojure\1.9.0\clojure-1.9.0.jar
#2022-02-2116:20Mario Angst@U0567Q30W I found a solution!
I tried creating a Leiningen project. Upon creating it, the IDE reminded me that there were two Maven repositories Build tools | Maven | Repositories that were not updated (the two remote ones: http://repo.clojars.org and https://repo1.maven.org/maven2). I updated those. Leiningen started working. Then I went back and created a brand new deps project and now everything works.#2022-02-2120:00cflemingI’ll try to figure out where the 1.9.0 could be coming from.#2022-02-2120:00cfleming@U0349822389 Could you DM me or email me the full classpath list from your log? Email is <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection>.#2022-02-2123:35cflemingActually, never mind, I’ve reproduced the problem.#2022-02-2200:09cflemingThis is a problem in deps, https://clojure.atlassian.net/browse/TDEPS-222. I’ll get a workaround into the next build.#2022-02-2209:51cfleming@U0349822389 1.12.2-eap5 is out now, and has a fix for this problem as described here: https://groups.google.com/g/cursive/c/O_oettEjv40/m/agRLYvdBCAAJ. I’m not sure how your previous fix could have worked, but this should do it. You’ll need to switch to using EAPs, see https://cursive-ide.com/userguide/#choosing-to-receive-eap-beta-builds. If you’d rather not use EAPs, then I think just using Deps 0.11.x versions should work. If you want to do that, just go to Preferences | Build, Execution, Deployment | Build Tools | Clojure Deps and configure the version there.#2022-02-2215:25Mario Angst@U0567Q30W sorry for being late, glad you were able to reproduce the problem. looking forward to the EAP. Cursive is amazing!#2022-02-2215:27Mario Angstyeah and for my "fix", that was not really a solution as you suspected, while it led to Cursive being able to proceed a bit further (no shim error anymore and run REPL option appeared on deps.edn), IntelliJ then started to crash building the classpath.#2022-02-2216:03Mario Angst@U0567Q30W happy to report back that after a fresh re-install of IntelliJ + Cursive latest EAP + updating Clojure Deps, everything seems to work fine now.#2022-02-2219:52cflemingGreat!#2022-02-2112:49souenzzoHey @cfleming. Every time that I try to generate stubs I receive this error:
I'm using t.d.a. 0.10.895 because:
• t.d.a. 0.11.x has a deadlock issue
• t.d.a. 0.12.x "fails to create a shim"
• using /usr/bin/clojure (mine is 1.10.3.1075 ) fails to generate stubs too, but do not generate ANY error in idea.log
https://gist.github.com/souenzzo/5808a677c539bbf353600c1cd38fdd9a#2022-02-2112:50imreStupid question: is cursive still indexing when you try to click generate stubs?#2022-02-2113:01souenzzonope. I already did a lot of things, like leave the IDE idle (any indexing/background process), wait a few minutes (to ensure that there is nothing running), wait, reboot, wait again, then click... always end up in the same error#2022-02-2113:04souenzzothis is just in one (huge) project, with ~50kloc of code, splited in ~20 projects/<sub-project>/deps.edn#2022-02-2113:04imreinvalidate caches dance?#2022-02-2113:04souenzzoin other small/simple projects stubs works#2022-02-2113:05souenzzo@U08BJGV6E I'm asking again because last week I bought a new machine, configured it from scratch (no backup/restore) and I still have the same error 😅#2022-02-2113:05imredamn#2022-02-2113:15imreis it an m2 by any chance?#2022-02-2113:19souenzzoI would like to have some better error reporting on it.
I mean, "Error trying to generate stubs for this jar on this project "#2022-02-2113:19imreThat would be helpful, yeah#2022-02-2113:21souenzzoAs I said, this project has ~20 subprojects.
I'm sure that is one of these that have a wired (probably, devtime) dependency that makes cursive unhappy
In my case, it is more practical to remove this subproject (from cursive indexing/intellij config) and ignore for now
Also, know which namespace/jar/project will definitively help to reproduce in another machine and fix the problem#2022-02-2119:06souenzzo@cfleming did you changed anything? I didn't anything updating#2022-02-2119:12souenzzoFixed the missing dep, now
com.intellij.openapi.project.IndexNotReadyException: Please change caller according to com.intellij.openapi.project.IndexNotReadyException documentation
at com.intellij.openapi.project.IndexNotReadyException.create(IndexNotReadyException.java:67)
at com.intellij.util.indexing.FileBasedIndexImpl.handleDumbMode(FileBasedIndexImpl.java:852)
at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:804)
at com.intellij.util.indexing.FileBasedIndexEx.processExceptions(FileBasedIndexEx.java:244)
#2022-02-2206:23cfleming@U2J4FRT2T No, nothing has changed in that code in a long time. The IndexNotReadyException definitely means that IntelliJ is indexing. Perhaps something is always provoking the indexing as part of the stub creation process? I can’t imagine what it could be, though.#2022-02-2206:45cflemingI’m also about to make a new release of Cursive which patches the problem with t.d.a 0.12.x, so you could also try that. Seems unlikely, though.#2022-02-2206:52cflemingI’ll see about improving that error message to report the module as you suggest, too - thanks.#2022-02-2400:29cfleming@U2J4FRT2T Just to let you know that I haven’t forgotten about this. I’ve pinged JetBrains to get some help diagnosing why your indexing is kicking off, I’m still waiting to hear back.#2022-02-2420:58cflemingOk, you could try this: go to Help | Edit Custom VM options… and add -Dtrace.file.based.index.update=true. For good measure you could also go to Help | Diagnostic Tools | Debug log settings… and add #com.intellij.util.indexing.FileBasedIndexImpl there. Then restart your IDE, and reproduce the problem. Hopefully you’ll see lines in your log from FileBasedIndexImpl, let me know what they look like. If you’d rather send them privately, email me at <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection>.#2022-02-2502:10souenzzo@cfleming I think that I will do it just on next will.#2022-02-2116:33AndreaI might have messed up my IJ/Cursive configuration and can no longer connect to nREPLs started by shadow cljs. When I connect my application logs a bunch of errors similar to the following
Unhandled REPL handler exception processing message {:code (try (clojure.core/cond (clojure.core/resolve (quote cljs.core/*clojurescript-version*)) :cljs (java.lang.System/getProperty "babashka.version") :babashka :else :clj) (catch java.lang.Throwable _ex__17614__auto__ nil)), :id 4b47f473-2c00-449a-9c7e-aeb0b94bc71a, :op eval, :session 0ed152b0-39af-480c-a0cb-638f00598290}
Syntax error macroexpanding at (cider/nrepl/inlined_deps/orchard/v0v9v1/orchard/java/parser.clj:1:1).
at clojure.lang.Compiler.load(Compiler.java:7665)
at clojure.lang.RT.loadResourceScript(RT.java:381)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.load(RT.java:459)
...
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: jdk.javadoc.doclet.Doclet
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
is the cider/nrepl path kind of expected in the stack? has this happened to any of you before?#2022-02-2120:55cflemingNo, that shouldn’t be there. Do you have it in your user deps.edn or project.clj?#2022-02-2210:38AndreaThank you! I’ll dig deeper into how cider/nrepl lands there, it sure injects some middleware that’s causing troubles...#2022-02-2211:13AndreaIndeed, not requiring cider/cider-nrepl 0.26.0 from the alias which I use for starting shadow fixes it. That dependency has been around for a while in the project, but only recently started to make troubles. I’ve always been connecting over shadow nREPL in the past#2022-02-2121:07jasonjcknhttps://mustafaakin.dev/posts/2021-12-08-running-intellij-idea-with-jdk17-for-better-render-performance/#2022-02-2212:59imreset this up, fingers crossed#2022-02-2223:25jasonjcknhaving some stability issues hbu ?#2022-02-2308:21imreNo problems so far but I haven't pushed it too much since setting it up#2022-02-2308:21imreIntelliJ IDEA 2021.3.2 (Community Edition)
Build #IC-213.6777.52, built on January 28, 2022
Runtime version: 17.0.2+8-b315.1 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.2.1
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 8
Registry:
scala.erase.compiler.process.jdk.once=false
Non-Bundled Plugins:
org.intellij.plugins.hcl (0.7.15)
net.seesharpsoft.intellij.plugins.csv (2.18.2)
name.kropp.intellij.makefile (213.5744.224)
de.thomasrosenau.diffplugin (2.1.8-imrekoszo)
com.jetbrains.plugins.ini4idea (213.5744.190)
org.jetbrains.kotlin (213-1.6.10-release-961-IJ6777.52)
org.jetbrains.idea.grammar (2021.1.2)
gherkin (213.6461.19)
dev.monogon.cuelang (0.8.3)
org.asciidoctor.intellij.asciidoc (0.36.18)
StringToolsPlugin (4.0)
String Manipulation (9.2.0)
Key Promoter X (2021.3)
mobi.hsz.idea.gitignore (4.3.0)
com.cursiveclojure.cursive (1.12.2-eap5-2021.3)
com.github.shinichy.integrant (0.1.1)
com.github.brcosta.cljstuffplugin (0.6.0)
EDN-JSON Converter (0.0.5)
org.intellij.scala (2021.3.18)
Kotlin: 213-1.6.10-release-961-IJ6777.52#2022-02-2510:32imreIt appears cmd+backtick switching between IJ windows doesn't work with this#2022-03-0618:59jasonjckndo you use vim plugin? i changed all the keymaps#2022-03-0619:41imreI'm not a modal person so not using ideavim. I did change most keybindings though. Cmd+backtick is a macos shortcut however and it works in other apps#2022-02-2201:13onetomis there any issue with naming vars starting with a $ sign?
clojure itself doesn't seem to mind it, but cursive underlines them as "no usages found", while others are properly resolved and navigable.
eg, in this snippet:
(def $cfg (-> :local api.env/cfg-rmap valuate! remove-nils (dissoc :ssm/params)))
(def $user-email (=> "
$cfg is ok, but both $user-email and $user-ref are marked as Unused global declaration, while $user-ref is clearly using $user-email right away on the next line.#2022-02-2204:55cflemingI’d have to check, but I have a vague recollection that Cursive might treat those as logic variables, with different symbol resolution.#2022-02-2207:41cflemingNo, I misremembered - that’s only in the context of Clara macros. I’ll try your snippet.#2022-02-2220:41onetomi tried it on 1.12.2-eap5-2022.1 and the problem still persist.
i've narrowed it further down; the symbol has to have a dash in it for the problem to manifest.
eg, this all resolves nicely:
(def user-email 123)
(def qwe user-email)
[qwe]
then i do a rename refactoring on user-email -> $user-email and this is what i get:#2022-02-2220:43onetomfunnily enough, i can navigate from the usage to the definition, but not the other way around.
this smells like interference of special-case handling logic with something fundamental about symbol indexing.#2022-02-2221:52cflemingThat is super weird.#2022-02-2221:53cflemingI’ll try with all those cases, thanks.#2022-02-2212:52wegiIs there any way to resolve vanilla js functions? For example the .preventDefault function of events and others are not recognized at all.#2022-02-2216:58salamthis is tracked here: https://github.com/cursive-ide/cursive/issues/2076#2022-02-2309:25wegiThank you for the link#2022-02-2214:27AJ JaroWe have a custom CLJS macro called defevent and I’ve resolved that as defn. I’m pretty sure I should then be able to do code navigation when calling that macro however it doesn’t seem to work. It worked previously at some point.
Current Plugin Version: 1.12.1-2021.3
Also verified on: 1.12.2-eap5-2021.3#2022-02-2214:33imreI saw similar behaviour today. What ended up working was getting Cursive resolve the macro as def, then when it finished indexing, telling it to resolve as defn again#2022-02-2214:34imre@U0567Q30W could this have anything to do with the recent config structure change?#2022-02-2217:27AJ Jarohuh, thanks for the suggestion @U08BJGV6E!! That worked for me!#2022-02-2220:45onetomi've also noticed something similar a few weeks back.
i set a symbol resolution to defn and an hour later i had to set it again.#2022-02-2308:23imreWill see if the issue comes back after yesterday's def/n dance#2022-02-2812:45imrethe workaround I suggested here doesn't appear to stick unfortunately, I opened the project again where I had done this earlier and now I have to do it again#2022-02-2306:31steveb8nQ: I have multi-module project (modules come from deps). I have enabled aliases from the other modules and I can see the libs in the deps panel. when I start the repl, those deps are not available to the compiler and startup fails. is this supposed to work?#2022-02-2320:32cfleminghttps://twitter.com/CursiveIDE/status/1496583065816088577#2022-02-2320:44Alex Miller (Clojure team)Just a reminder that the State of Clojure 2022 survey https://www.surveymonkey.com/r/clojure2022 is open and to make sure you register your use of Cursive (Question #20)#2022-02-2321:20cflemingThanks Alex, I actually haven’t done that myself yet.#2022-02-2422:27Miķelis VindavsHello! I just upgraded Cursive and now namespace references have a different color from symbols. I can’t find which setting controls it under “Color Scheme”.
Is this intentional? Is there any way to customize it?
Here’s a screenshot of what I mean — before, cljs.core.async would be the same color as /go or /partition respectively.#2022-02-2422:30Miķelis VindavsSorry, it’s not Cursive after all — turns out it was the Clojure Extras plugin which I installed at the same time.#2022-02-2513:33Ivar RefsdalI'm getting
com.intellij.execution.ExecutionException: Cannot execute: Command failed when executing /usr/local/bin/clojure
whereas in the terminal it gives me:
$ /usr/local/bin/clojure
Clojure 1.10.3
user=>
Anyone else experiencing this?#2022-02-2519:25cflemingThere was an error similar to this a while ago, which I thought I had fixed: https://github.com/cursive-ide/cursive/issues/2561. Do you have a JDK configured in your project?#2022-02-2519:31cflemingAlso, could you send the whole stacktrace you’re seeing?#2022-02-2810:07Ivar RefsdalNo, I didn't have a JDK configured. After I added one, it worked#2022-02-2810:07Ivar RefsdalThanks for replying though 🙂#2022-02-2513:35Ivar Refsdal(I'm on a new/fresh install using jetbrains sync, don't know it that matters.)#2022-02-2515:43Ivar RefsdalRight, so I found out that the error message was:
Couldn't find 'java'. Please set JAVA_HOME.
#2022-02-2515:53Ivar RefsdalFor those curious: I installed java using sdkman#2022-02-2816:11isakIs this a bug? I didn't expect the requires aligned when I have this setting on (just indented):#2022-02-2821:03cflemingHmm, could be - ns has some special formatting, and it’s possible that it doesn’t take that setting into account.#2022-03-0104:10kingmobIs there something special I have to do, to get vars resolved in a top-level deps tool file? I have a top-level build.clj file, and build is checked as a “Tool Alias” in the Clojure Deps tool window. Is there more to do to get Cursive to resolve, or is something wrong with my setup?#2022-03-0120:03cflemingI found the way Cursive achieves this to be a little flakey at an IntelliJ level. If you close your project and re-open it, does that fix it?#2022-03-0122:19cfleming(it’s not required to completely shut down the IDE to test this, just close the project, although completely restarting is one way to achieve it).#2022-03-0123:01steffanI've experienced this too, closing and reopening the project (mostly) seems to fix it, and then project seems to stay OK.#2022-03-0123:52cflemingYes, that’s been my experience too. I suspect that it might still be flakey when adding new deps, for example, but I don’t do that often enough to be sure.#2022-03-0200:01cflemingHopefully if it is, reopening the project would help with that too - I expect so.#2022-03-0211:39kingmobClosing/reopening didn’t help. I could try deleting the IDEA files/dirs and reimporting.
I’m not sure if it’s related, but it wasn’t even identified as a deps.edn project at first. I was tearing my hair out for a while trying to locate the tools.deps window, but cycling the power fixed that, at least.#2022-03-0211:46kingmobOK, I wiped the IntelliJ files, reimported, toggled checkmarks a bunch, opened and closed several times, and eventually it figured it out.#2022-03-0212:26reefersleepI’m getting “x cannot be resolved” warnings for pretty much all of the symbols in my cljs files. src is marked as sources root, I’ve right clicked on the project.clj and clicked “Add as leiningen project”, and I’ve tried invalidating and restarting.#2022-03-0221:01cflemingCould you look at this list? https://cursive-ide.com/userguide/troubleshooting.html. Sounds like you’ve tried most of it, but looking at the dependencies might give a clue.#2022-03-0808:28reefersleepI’ll do that, thank you 🙂#2022-04-2114:04reefersleepI couldn’t figure out what was wrong - the list of dependencies is really long, so I never really got going checking them. Instead, I tried installing the newest IntelliJ + Cursive, and now, my problem is gone.
As always with this type of thing, I’m really bothered that I don’t understand what was wrong and why it appeared seemingly out of nowhere. But life is too short to dwell on that 🙂 Gotta get coding!#2022-03-0212:27reefersleepIt’s extremely distracting! 😞 And I feel like this is probably just some configuration/cache clearing issue, though I have no clue what. I haven’t changed anything recently, that I know of.#2022-03-0212:33imrehave you tried invalidate caches/restart?#2022-03-0212:45reefersleepI did 😞#2022-03-0212:46imre😢#2022-03-0212:48reefersleepIt’s one of my favourite debugging cannons, usually#2022-03-0212:49reefersleepThank you for your suggestion 🙂#2022-03-0212:35manutter51Do you have separate clj/ and cljs/ directories under src/? If so, you might need to mark your cljs/ dir as a sources root.#2022-03-0212:48reefersleepI don’t, but good to know!#2022-03-0212:49reefersleepThank you for the suggestion 🙂#2022-03-0214:38aratarehave you tried checking if you've setup Java Sdk correctly for the project? I've also encountered this several times and usually it could be solved by this.#2022-03-0220:05the-alchemistthis seems like a bug.
it says “Run Configuration Error: Script does not exist”, but the run configuration actually runs fine#2022-03-0220:23the-alchemist#2022-03-0223:34staypufdHello group,
I'm wondering if anyone has been able to make "Run with Deps" alias to work?
I get this error:
class java.lang.Character cannot be cast to class java.lang.String (java.lang.Character and java.lang.String are in module java.base of loader 'bootstrap')
#2022-03-0223:34staypufdThis is the alias I pass in.#2022-03-0223:35staypufdMy Clojure Deps#2022-03-0223:38staypufdOh, I found a bug report for it:
https://github.com/cursive-ide/cursive/issues/2617
So I guess it'll be in next update or two...#2022-04-2114:04reefersleepI couldn’t figure out what was wrong - the list of dependencies is really long, so I never really got going checking them. Instead, I tried installing the newest IntelliJ + Cursive, and now, my problem is gone.
As always with this type of thing, I’m really bothered that I don’t understand what was wrong and why it appeared seemingly out of nowhere. But life is too short to dwell on that 🙂 Gotta get coding!#2022-03-0306:23EdmundHi all. I decided to give cursive a shot on Windows. Installed the plugin and followed the getting started guide but right out of the box it gives the below error. What could I be missing. I can't seem to find anything on this anywhere.
java.lang.RuntimeException: Could not create shim
at cursive.shim.ShimProvider.getShim(Shim.kt:148)
at cursive.shim.ShimProvider.withShim(Shim.kt:115)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:176)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:87)
at cursive.build.BuildSystemProjectDetails.getProjectDetails(BuildSystem.kt:45)
at cursive.build.BuildSystemProjectsManager.reimportAllProjects$lambda-3$lambda-2(BuildSystemManager.kt:149)
at cursive.build.BuildSystemUtil$runTask$1$1.run(BuildSystemUtil.kt:83)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:436)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:120)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsync$5(CoreProgressManager.java:496)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:244)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:624)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:698)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:646)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:623)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:244)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.lang.RuntimeException: Unable to resolve symbol: requiring-resolve in this context, compiling:(clojure/tools/deps/alpha/util/s3_transporter.clj:27:22)
at clojure.lang.Compiler.analyze(Compiler.java:6792)
at clojure.lang.Compiler.analyze(Compiler.java:6729)
...#2022-03-0306:25cflemingHi Edmund, this is a bug which is fixed in the current EAP (beta) series, the fix hasn’t made its way into a stable build yet. If you don’t mind switching to the EAP builds, you can follow the instructions here: https://cursive-ide.com/userguide/#choosing-to-receive-eap-beta-builds#2022-03-0306:26EdmundHi @U0567Q30W. Thanks a lot 🙏#2022-03-0312:06EdmundStill getting the same issue on the latest EAP versions. Also tried old versions and still got the same issue. Could there be some setting somewhere I'm missing?#2022-03-0317:59steffanIf your project uses deps.edn and you are using the option Settings > Build, Execution, Deployment > Build Tools > Clojure Deps > Use tools.deps directly (as you are seemingly forced to on Windows, as I can't for the life of me figure out the correct Path to clojure command setting for the Use CLI tools option) then I may have the answer for you as I ran into this myself. There was a very recent bugfix in tools.deps which you can pick up by clicking the Refresh button, then selecting the latest (`0.12.1153`), then clicking Download#2022-03-0319:04EdmundI already have that setting and its on the latest version of tools.deps.#2022-03-0320:09cfleming@UR7H0UC0M Sorry, there’s an extra step required, detailed in the release notes of the EAP fixing the bug: https://groups.google.com/g/cursive/c/O_oettEjv40/m/agRLYvdBCAAJ#2022-03-0320:11cflemingApologies for not mentioning it earlier.#2022-03-0419:22potetmOkay got a wild one#2022-03-0419:22potetmthat’s actually legit^#2022-03-0419:22potetmbut f shows as unresolved#2022-03-0419:23potetmproof#2022-03-0419:28Alex Miller (Clojure team)that code should be considered undefined. don't compute things in :or#2022-03-0419:29potetm:feelsbadman:#2022-03-0419:58potetmHonestly, it never occurred to me until today. @alexmiller Is it primarily a semantic breakage or is there a technical limitation as well?#2022-03-0420:07Alex Miller (Clojure team)semantic expectations is what I'm talking about - maps are unordered and you should not expect that :or is necessarily handled here before :as, even though they are lexically ordered#2022-03-0420:07Alex Miller (Clojure team)basically, we have not defined semantics around the ordering, so you shouldn't assume any#2022-03-0510:01tobiasIs there a trick to update the Babashka version seen by Cursive? I've update Babashka with homebrew but somehow Cursive is still seeing the old version of Babshka#2022-03-0510:02tobiasVersion in Cursive REPL:#2022-03-0510:02tobias#2022-03-0510:03tobias... is older than version in terminal#2022-03-0522:32DrLjótssonCan I type hint a js event so that Cursive recognizes for example .stopPropagation?#2022-03-0604:38cflemingUnfortunately no, at the moment. I’m working on some short-term fixes right now so that the complaint is less annoying, and I’m planning some long-term fixes that will hopefully help those symbols to actually work better.#2022-03-0607:17DrLjótssonThanks!#2022-03-0619:01jasonjcknanyone use the vim plugin with cursive, do you know if there’s a way to do key bindings based on the filetype=clojure in ~/.ideavimrc? vim’s autocmd isn’t supported.#2022-03-0721:25seriogaNot possible AFAIK#2022-03-0722:44tawongaYep. Works great in latest versions of the plugin#2022-03-0722:46tawongaif has('ide')
if &ide ~=? 'intellij idea'
...clojure specific config here
endif
endif#2022-03-0722:47tawongaOh, now I see. This works for me as I use Intellij idea for cursive only...may not apply to you#2022-03-0716:52scarytomWhat's the latest on ClojureScript support in Cursive with regards clicking through into 3rd party npm dependencies? I'm using shadow-cljs and currently my require blocks and later references are all yellow. Last I heard this was something that Colin was going to look into, but I'm guessing that's still on the TODO list? Anyone got any workarounds for this?#2022-03-0720:54cflemingRight now I’m working on making the screaming less for JS interop, as well as handling string requires properly. The second part there requires unpicking some very old code for handling ns forms, which was probably some of the first code I ever wrote in Cursive. But I’m hoping both of those fixes will be in the current EAP series.#2022-03-0720:55cflemingAnd I have plans also to try to index JS libs better for better IDE features, but that won’t be in this series.#2022-03-0723:04scarytomfantastic news, thanks#2022-03-0817:28cjsauerIs it possible to add a shadow-only module? I only have a shadow-cljs.edn file, without deps.edn or project.clj. Doesn't seem I can add it as a module though...every var in the project is showing up as undefined...#2022-03-0817:43thhellerhttps://shadow-cljs.github.io/docs/UsersGuide.html#_cursive#2022-03-0817:47cjsauerBrilliant. Thank you so much.#2022-03-1114:27Nom Nom MousseEvery single word is marked as cannot be resolved. What am I doing wrong?#2022-03-1114:30Nom Nom MousseI tried opening the project as project.#2022-03-1114:31Nom Nom Moussehttps://cursive-ide.com/userguide/eap/troubleshooting.html#help-lots-of-symbols-don-t-resolve#2022-03-1114:31souenzzoCheck your "project structure" window
at project tab, it should have a JVM defined at sdk
at modules, it should have at least one module
Are you using project.clj or deps.edn?#2022-03-1114:35Nom Nom MousseIt seems to be fixed by setting a project SDK. Thanks..#2022-03-1114:48Nom Nom MousseIt seems like I can't write start of a parens without inserting a closing parens. Is there a way to turn this off?#2022-03-1114:51Nom Nom Moussehttps://stackoverflow.com/questions/35091783/cant-delete-parenthesis-in-intellij-cursive#2022-03-1116:08imredo have a look at https://cursive-ide.com/userguide/paredit.html - it's an excellent tool to work with a lisp#2022-03-1409:56henryw374I've got 2 repls going. is there a command to focus one, or tab through them or something? google+docs failing me so far. thanks#2022-03-1410:22Ivar RefsdalThere is "Jump to REPL editor" which you can assign to a shortcut.
Once focused, you may use alt-left or alt-right to cycle through them#2022-03-1410:23Ivar RefsdalI think the default key for jump to REPL is Ctrl+\#2022-03-1410:42henryw374ooh. alt+left/right. that's what was eluding me. thanks!#2022-03-1505:23indyI might have replaced the alt+left/right. Mind telling which action is triggered to cycle through the REPLs?#2022-03-1510:17Ivar RefsdalIt seems that is Main Menu -> Window -> Editor tabs#2022-03-1510:17Ivar Refsdal(not Cursive per se)#2022-03-1510:18indyPerfect, thank you!#2022-03-1420:38cflemingIf you’re on the 2022.1 EAP and have noticed that Navigate to Keyword and Navigate to Namespace don’t work there, please vote for https://youtrack.jetbrains.com/issue/IDEA-290436.#2022-03-2201:25staypufddone - it's up to twelve votes#2022-03-2208:18cflemingThanks - it’s slated to be fixed in 2022.1, thankfully.#2022-03-1515:19ViktorDoes anyone know if there is a way to show these test result info popups using the keyboard only? (I can only get them to show by hovering over them with the mouse)#2022-03-1515:34Jordan Robinsonlast I checked there was no way but I'm also eager to find out if that's changed since#2022-03-1515:34Jordan Robinsonhopefully someone else has found a way#2022-03-1515:34Jordan Robinsonif I recall you can also click the circle next to the line number#2022-03-1516:26ViktorThanks @UC3B7UJF2. I’ll try to create a ticket#2022-03-1516:27Jordan Robinsonrelated: https://github.com/cursive-ide/cursive/issues/2229#2022-03-1516:33Viktoramazing! upvoted#2022-03-1612:34kennytiltonMacros pulled in from a require are not resolving such that I can jump to their definition. Functions work OK in this regard. Macros do compile fine.
[tiltontec.mxweb.gen-macro
:refer-macros [audio img input figure p a span div button br]
:as mxw]
Originally the :as option was not being specified, but I tried it to match the doc example with gloss. No help.
The doc says "When the caret is the head symbol of a macro form which is not handling the symbol resolution correctly, you'll see the intention lightbulb near the left margin and you can use ⌥↩️ to customise how that form is interpreted:" but all I get is an option to create a function of the same name.
I made it to "Preferences>Languages & Frameworks>Clojure>Symbol Resolution" but that just says "Nothing to show" and offers no "+" button.
Is this in fact doable? Thx!#2022-03-1700:25cflemingHow are those macros defined in tiltontec.mxweb.gen-macro? Is there a (defmacro audio [] ...) there somewhere, or are they autogenerated somehow?#2022-03-1712:22kennytiltonThe macros are auto-generated, by a macro-writing macro. 🙂#2022-03-1720:19cflemingSo that’s the problem - Cursive has no way of knowing what those macros are. For libraries, this is handled by stub generation (https://cursive-ide.com/userguide/macros.html#stub-generation). However this currently only works for specific hard-coded namespaces. I have plans to allow you to specify namespaces which get this treatment, but initially at least they will probably only be from libraries, since the cache invalidation is very complicated otherwise.#2022-03-1812:43gregIs there a way to make correct meander's syntax highlighting?#2022-03-1821:41cflemingThere’s an issue to add support for that, I’ll try to get to that soon: https://github.com/cursive-ide/cursive/issues/2302. In the meantime, you can use “Resolve as: None” as a workaround, see: https://cursive-ide.com/userguide/macros.html#customising-symbol-resolution#2022-03-1912:05SKHow to load a namespace on REPL startup? For example I'd like to silence a few loggers, set up humane-test-output for tests, etc.#2022-03-1923:59AJ JaroCan you include it in your user namespace?#2022-03-2020:36cflemingRight, user.clj is generally the best way to achieve this. Note that humane-test-output interferes with Cursive’s test integration, in case you want to use that.#2022-03-2203:01Mr. SavyI just wanted to stop in and say that I came back to clojure recently and played around a bit with cursive. I was able to get a debugger repl running and play around inside some toy functions and eventually I plan to be more comfortable using a repl driven development style. In the meantime, as a novice, having access the the intellji debugger is a much welcome feature that makes becoming more familiar with the dev enviroment a much smoother process. Thank you for your work @cfleming!#2022-03-2204:14cflemingThanks for the kind words! I’m glad Cursive is helping to make Clojure more accessible for you. That’s one of my major goals.#2022-03-2215:04AJ JaroI’m still periodically getting custom macros that are not resolved like I specified them to be. The work-around here is to resolve as def and then resolve as defn again. It’s like Cursive is losing the context of those custom macros resolutions
Built on: 2022-02-24 09:26
Built from: 1.12.2-eap6-13-g96b19682
#2022-03-2216:42markaddlemanfwiw, I see the same issue. Seemingly randomly cursive (or intellij?) seems to forget custom macros. I resolve the problem by doing the same thing#2022-03-2219:31cflemingAre these in CLJS or just plain CLJ?#2022-03-2219:31markaddlemanCLJ#2022-03-2219:31markaddlemanI have not tried in CLJS#2022-03-2219:37cflemingOk thanks, a few people reported that it was more prevalent in CLJS, but that may have just been chance.#2022-03-2219:38cflemingWhen this occurs, could you check in Preferences | Languages & Frameworks | Clojure | Symbol Resolution and see if the macro in question is still present there in the configuration? It would be interesting to know if it’s failing despite the config being present, or if the config is falling off somehow.#2022-03-2219:46markaddlemanSure. I'll take a look at that next time#2022-03-2221:46cflemingI’d also like to know if this only happens for a single macro at a time, or if it suddenly appears to lose customisations for all macros.#2022-03-2223:53AJ JaroI have this happen in CLJS fairly often. I'll take a look in the preferences area next time around. Thanks!#2022-03-2416:55markaddlemanHere's a case. You'll see that mount's defstate is not resolving correctly#2022-03-2416:55markaddlemanBut it is in the symbol resolution table:#2022-03-2416:56markaddlemanThe meander macros are handled correctly in the same file#2022-03-2416:58AJ JaroYeah, hey! I just had this fail again this morning and am seeing the same thing as @U2845S9KL. It’s not resolving even though it is declared as such#2022-03-2421:12cflemingOk, thanks, that’s helpful. I’ll look to see what might be going on there.#2022-03-2220:50markbastianHey, just tried out the babashka repl in Cursive. Love it! One question, though. When I set environment variables in the run config they don’t seem to be getting set when I call (System/getenv). Is this a bug? E.g.#2022-03-2220:51markbastianThen in the repl:#2022-03-2221:32cflemingHmm, could be, yes. Could you file an issue and I’ll look at that?#2022-03-2221:39markbastianhttps://github.com/cursive-ide/cursive/issues/2670#2022-03-2221:42cflemingThanks, I’ll look at that for the current EAP series.#2022-03-2302:32aratareHi there. I have this piece of code
[{`(foo/bar {:a 1}) [:b/c]}]
where foo/bar is a function that takes in 2 arguments, hence Cursive is throwing an error under foo/bar saying I'm providing 1 instead of 2 arguments. However since the the form is quoted, I'd expect this error to not be there. Is there anyway to achieve this currently in Cursive? Specifically to turn off syntax checking if the form is quoted? Thanks in advance.#2022-03-2507:22danierouxI am on a quest to get consistent formatting (on command, not automatically) across different editors, again.
Most of the codebase is https://tonsky.me/blog/clojurefmt and I have set up Cursive to follow it. Except, that Cursive does not align to :require as it needs to:
(ns user
(:require
[dev-server]))
☝️:skin-tone-2:this is what Cursive does.
"Non-symbol lists, vectors, maps and sets are aligned with the first element" so I want:
(ns user
(:require
[dev-server]))
(a filewatcher that runs cljfmt is not practical, until I can get it compiled under Graal, which is a rabbit hole I don't want to be in simple_smile)
(https://calva.io/formatting/#indentation-rules is what we use for Calva)#2022-03-2508:34cflemingI don’t think so, sorry, that is: https://github.com/cursive-ide/cursive/issues/2665, which I haven’t looked at yet.#2022-03-2523:40jasonjckn@U9E8C7QRJ i’m interested in your quest, if you have any intelliJ XML files and emacs configs that all work together, would be interested in seeing it published here.#2022-03-2608:01cfleming@U0J3J79FE There’s some information here: https://cursive-ide.com/userguide/formatting.html#matching-indentation-to-emacs#2022-03-2700:08cfleming@U9E8C7QRJ I’m sorry, I didn’t read your message carefully enough, and assumed it was the same case as that issue. It’s not, the option you want is “One space list indent”, discussed in the doc I linked.#2022-03-2507:22danierouxIs there any way to get what I want, that I am missing?#2022-03-2620:14SKhi! how can I profile Clojure code via Intellij? I've tried to start a REPL using the intellij profiler, but it pops up a red window saying cannot patch configuration, as described in this ticket: https://github.com/cursive-ide/cursive/issues/2514 . Any hints/tips how to do profiling? thanks!#2022-03-2701:53Oliver GeorgeI'd love cursive to help me write specs for my functions. Infer stuff and generate s/fdef statements... Lift s/asserts to be s/fdefs...#2022-03-3101:26cflemingThere are a bunch of issues at https://github.com/cursive-ide/cursive/search?q=spec&state=open&type=issues, but not one overarching one. I’m kind of torn with spec support at the moment to be honest, since it seems that spec 1 is unofficially deprecated, and who knows how much will carry over to spec 2.#2022-03-3101:33Oliver GeorgeI feel your pain. Perhaps there's some baseline functionality that spans some common functionality provided by things like malli / spec 1...#2022-03-3101:34Oliver GeorgeWhat would give you confidence it's worth the effort to explore? I help form (foment?) a mob...#2022-03-3103:59cflemingI mean, Rich or Alex saying “this is the plan” would help, but even then it’s hard to tell how spec 2 will come out, or when that might happen.#2022-03-3104:13Oliver GeorgeYeah, that's a bit of a sticking point isn't it. They're not fans of committing to roadmaps. Kind of a shame there isn't some kind of inner sanctum for key tool providers to help provide certainty (allowing you to invest effort with more confidence)#2022-03-3104:14Oliver GeorgeAs always, love your work... (but if cursive deletes my [goog.obj :as gobj] statement one more time I may cry)#2022-03-3104:17cflemingUgh, sorry, that’s https://github.com/cursive-ide/cursive/issues/638 which is fixed for the next build, but that is taking a while…#2022-03-2701:53Oliver GeorgeAny chance there's a github issue I can watch?#2022-03-2813:21Nom Nom MousseVim-mode: If I press * over a term I'm used to it searching for the whole term. I.e. pressing * over unconnected-nodes searches for the whole term, not just unconnected. What is this behavior called in IntelliJ? How do I switch 🙂 ?#2022-03-2818:52okworiCtrl+Shift+F on a selected text...#2022-03-2821:44cflemingUnfortunately I don’t use IdeaVim, so I’m not sure about this. The default word-select in Cursive selects the whole symbol, so if IdeaVim is just selecting a segment it’s IdeaVim doing that. I’m not sure if you can configure that, sorry. Perhaps this will help? https://github.com/cursive-ide/cursive/wiki/Mapping-IdeaVim-actions-to-Cursive-actionshttps://github.com/cursive-ide/cursive/wiki/Mapping-IdeaVim-actions-to-Cursive-actions#2022-03-2908:11Ivan FedorovCan I set up columns in let ?
(let [val 1
name "Baz"
fav-meal "carrot"])#2022-03-2908:33MatiasYes, Settings -> Editor -> Code Style -> Clojure -> General -> Align let-binding values#2022-03-2908:35Ivan Fedorov@U012GHQR89X AWWW! DANKS ❤️bmo#2022-03-3016:26wilkerlucio@cfleming I'm having this strange issue with Resolver ... as... funcionality, in Pathom 3 I use the Guardrails >defn function a lot, and I set cursive to resolve that as defn, but from time to time Cursive seems to forget about that, the setting is still there, but Cursive stops recognizing the symbols defined by >defn, the current fix is being to switch from clojure.core/defn to cljs.core/defn and them things get back (and the reverse once the issue happens again). but this has happened a couple of times already and everytime I close and re-open IntelliJ seems a risk to. Any idea what's may causing this?#2022-03-3016:27wilkerluciojust notice it seems the same as: https://clojurians.slack.com/archives/C0744GXCJ/p1647961488449569#2022-03-3016:57imreAnd https://clojurians.slack.com/archives/C0744GXCJ/p1645540040848229#2022-03-3100:25cflemingYes, I need to investigate that but haven’t got to it yet, sorry.#2022-04-0114:21AJ JaroThis happened again today#2022-04-0108:47Jakub Holý (HolyJak)@cfleming do you have any plans to eventually support the :style/indent metadata (https://github.com/cursive-ide/cursive/issues/1967)? thank you!#2022-04-0121:16cflemingSo I’ve been looking at this recently, with a view to making the Cursive formatting more compatible with cljfmt, particularly. But I don’t like the cljfmt specification much, so I think I’ll support the :style/indent form instead. So, yes is the short answer.#2022-04-0121:37Jakub Holý (HolyJak)Awesome! I hope that cljstyle and cljfmt will also adopt it eventually, with little push / help from the community ...#2022-04-0214:53jeffmkWas told I may have better luck here, so x-posting:
> Anyone know of good no-frills guides for getting a minimalist ClojureScript project up and running from scratch, that integrates well with IntelliJ/Cursive? I've been out of the CLJS game for a while and frankly what's out there from my searches is pretty confusing to me. I'd prefer to take a deps.edn and/or shadow-cljs route if feasible. Ultimate goal is to get a Reagent site going, if that changes anything#2022-04-0222:51cflemingI’d recommend just using the Shadow documentation for the initial project setup, it’s what I use for my CLJS projects and it works well. I just use plain Shadow but it’s easy to combine with deps as well if you want to. Thomas is a Cursive user and is super responsive in the #shadow-cljs if you get stuck. Once you have the basic project set up then any Reagent tutorial should do, I think.#2022-04-0305:24jeffmkThanks! I like that approach (avoiding deps.edn), since my current goal is to minimize complexity. I think shadow-cljs pom did the trick for getting Cursive to see Reagent properly#2022-04-0217:52SKhi! how can I profile Clojure code via Intellij? I've tried to start a REPL using the intellij profiler, but it pops up a red window saying cannot patch configuration, as described in this ticket: https://github.com/cursive-ide/cursive/issues/2514 . Any hints/tips how to do profiling? thanks! (sorry for the repeated question, but got absolutely no reaction a week ago)#2022-04-0219:28Ivar RefsdalHi.
My advice does not specifically address your question, but may be helpful nonetheless:
I recommend clj-async-profiler: https://github.com/clojure-goes-fast/clj-async-profiler
Works great, very little hassle.
There is also tufte, though you need to manually tell what to profile: https://github.com/ptaoussanis/tufte.
Neither is specific to Cursive.#2022-04-0219:34Ivar RefsdalOne small note:
"Our" Clojure JVM containers running in the cloud (Azure Container Instances) are not able to use clj-async-profiler due to some kernel restrictions...
So there profiling something "live" in production/stage we need to use tufte.#2022-04-0222:52cflemingCursive doesn’t have any explicit functionality for profiling, and I haven’t had a chance to look at that issue, sorry.#2022-04-0310:04SK@U0567Q30W the issue is about allowing the intellij built-in profiler to cooperate with Clojure. Maybe there is only some small issue preventing the start of a cursive REPL with profiling and if that would work, cursive would gain profiling "for free"#2022-04-0310:06SK@UGJE0MM0W thanks! Tufte I've tried but - as you say - manually adding all relevant functions is kind of a hassle. The clj-async-profiler looks good, I'll give it a try! thx#2022-04-0322:23cflemingSure, I understand, I’ll try to look at that to see if it’s an easy fix.#2022-04-0220:46BenjaminCurious if it is possible to use Cursive and Cider at the same time. In particular, is there a way to use the nrepl-refactor middleware with Cursive?#2022-04-0222:53cflemingNo, there isn’t, sorry. Cursive does allow you to define REPL commands which you might be able to hook up to refactor-nrepl, but I’m not aware of anyone having done it, and it’s likely tricky since it expects you to be using middleware.#2022-04-0301:35BenjaminAh okay. I think I've got most of what I was after by starting the nrepl first with Cursive, and then connecting to that repl with Cider. Doesn't have the refactor middeware of course, but by hooking up clojure-lsp I get most of that functionality at the cost of ~ 2GB more RAM.
Thank you for Cursive by the way, it has been very helpful! I learned both Clojure and Emacs at the same time. Took a bit to get everything going. I am very impressed with how much Cursive does for you out of the box. Great UX.#2022-04-2500:51genekimSeriously, is there a reason not to run Debug REPL mode all the time?!?#2022-04-2500:51Joshua SuskaloI would imagine it has some pretty significant performance implications#2022-04-2500:52Joshua Suskalosince the JIT can't work anywhere near as hard, if it works at all. I don't know how IntelliJ does it, but it's entirely possible it's falling back on bytecode interpretation all the time in debug mode.#2022-04-2500:52cflemingIt’s actually not too bad, and depends on what you’re doing. When I’m developing Cursive, I pretty much always run it in debug mode.#2022-04-2500:52Joshua SuskaloThat's good to know#2022-04-2500:53cflemingNo, it’s not bytecode interpretation. This is a built-in JVM feature, not something that IntelliJ implements.#2022-04-2500:54cflemingWhat I do find is that sometimes the JVM can get into a funky state, that happens from time to time, so I do end up restarting more often when debugging.#2022-04-2500:54Joshua SuskaloAh, I see#2022-04-2500:55cflemingSorry, I mixed up my acronyms there, JDPA is the platform bit, and JDI is the interface you would almost certainly use to it: https://www.baeldung.com/java-debug-interface#2022-04-2500:56cflemingBut the JVM is actually very efficient at debugging. I wouldn’t want to run my prod systems in debug mode, but for development it’s a no-brainer IMO.#2022-04-2501:00genekimHoly cow. I’m seeing the local vars in the editor.
Seeing if I can change that b to (inc b), and rerun that division operation…#2022-04-2501:01genekimOh, no… I can’t do that, because there’s no running JVM to recompile the JVM bytecode, when I reload the namespace, is that right, @cfleming?#2022-04-2501:02genekimI.e., I can’t just reload this namespace, “drop frame”, and resume program, correct?#2022-04-2501:03cflemingWell, the JVM is paused, correct. That’s what I mean when I talk about a debug REPL, it would be a REPL that would evaluate code over the debug interface rather than the REPL interface, since the REPL isn’t currently listening.#2022-04-2501:04cflemingThere’s some UI trickiness to work out there, since a REPL is a single conceptual context, and the debugger is really lots of them. What I mean by that is that you can evaluate expressions at any level in the stack frame, and in each one your locals etc are different.#2022-04-2501:05cflemingSo I’m not 100% sure how to expose that to the user. You might want to be able to evaluate REPL commands ten levels down in your stacktrace to see what was going on at that time.#2022-04-2501:10genekimSorry — lots of neurons firing right now.
What you’re describing would be amazing — like, brainmelting amazing, right?
I feel like I need to think about what would be most useful before I even opine on this — can I share with you some excerpts of the Glamorous Toolkit sessions, to frame some of the aha moments that even led to asking about the debugger?
I think it may trigger some thoughts on what people are talking about when they gush about what’s been lost in the post Smalltalk era.
(I’ve been working on a blog post to try to articulate and share these aha moments behind GT, membrane, cljfx, and ultimately Fulcro and RAD. I think it’s be around 8K words.)#2022-04-2501:12genekimIn the meantime, thanks for helping me understand the power of the debugger — I know this will change the way I problem solve issues. As you said, “hammocks are good,” but in many situations, “debuggers are better,” because you can actually see what you’re doing!#2022-04-2501:15genekimColin, I’d recommend watching at the 20m mark in this video — you can see how quickly Tudor is able to get tweet images displayed inside GT, something difficult (impossible?) to do in typical IDE — which is why I use Portal so rabidly now, as well as Clerk.
I’ll try to find the video where they keep yelling at me to stop closing the Pharo debugger! 🙂#2022-04-2501:15genekimhttps://twitter.com/RealGeneKim/status/1469389359249956869#2022-04-2501:29cflemingYes, I’m always interested in understanding how other systems work! I’ll take a look at that in a minute, BRB#2022-04-2501:33cflemingOne thing I have considered is whether to just let people open a REPL on their Cursive instance (which is just a JVM instance, after all) and go wild. The risk is that you bork your IDE terribly and have to restart, but it opens up more possibilities in terms of using the same UI for the editor and the app, which both Smalltalk and Common Lisp systems tend to do. Unfortunately it also does mean that you can’t debug, though.#2022-04-2501:35genekim(PS: Armed with my newfound ability to write UIs quickly using Fulcro, I have all Zoom recordings in XTDB… I’m searching for my Zoom sessions w/Eric and Tudor, so I can upload them to YouTube. Finding these recordings are such a pain w/o something like it!)#2022-04-2501:39aratareSurprisingly I feel like I don’t ever use debug mode in Cursive because of how tight the feedback loop is, i.e. an exception thrown can be handled by just a simple workspace reload away. To the point where I always forget to use debug mode when working with Java.#2022-04-2501:40aratareBeing able to code handler on the fly sounds really amazing but I struggle to see how useful it is, or may be that’s just because I haven’t seen it in action yet#2022-04-2502:07cfleming@U6VPZS1EK I think I’m going to have to go through those videos when I have more time, and probably try to replicate them myself in GT. Just watching them without the background of what is going on, I feel like I miss a lot without understanding the basics, and those videos are pretty long to catch up 🙂#2022-04-2502:09cflemingUnfortunately their getting started doc is pretty much “Here’s how you open your IDE, have at it!” which isn’t really enough to get started, as a curious bystander.#2022-04-2502:10genekimNo worries at all — I’ll send you 2 or 3 more selected excerpts which I think you’ll find interesting. Sorry they’re not edited down, they don’t have much background.
I do put in a tweet a summary. I’ll send those your way, as well.
(And you’ll definitely see the rough edges around GT — it was tough sledding at times, esp for Eric, who seemed to step on every landmine there was. 🙂#2022-04-2502:11genekimOnly watch if it gives you joy. 🙂 I will try to narrow down 10m that I think would be of specific interest w.r.t our discussion above!
(In next couple of days.)#2022-04-2502:11cflemingThanks, I’d definitely be interested to see them. Are you aware of any good getting-started resources, apart from getting personally tutored by the creator? 🙂#2022-04-2502:11cfleming(that looks like a great way to do it BTW)#2022-05-0719:46phronmophobicAs food for thought, making the feedback loop more granular can, in some ways, be better than an imperative debugger. Especially with a functional language like clojure, you get all the incremental feedback, but without having to manually step because functions are pure and time isn't an input.
I'm not sure how to best integrate side effects, but it's unclear if the "debugger approach" handles including side effects gracefully either.#2022-05-0903:12genekimWhat sorcery are you potentially unleashing unto the world, @U7RJTCH6J ?!?
That's utterly wild. I'm not even sure what I'm looking at, but it's amazing!! 🤯🤯
Written in membrane? And some sort of container for ns forms, with live evaluation?
Tell us more!!!#2022-05-1320:29genekim@U7RJTCH6J Are you going to ever tell us what magic you’re working on, that you’re showing us above? 🙂#2022-05-1321:28phronmophobicI've been reluctant to share because I haven't thought of a cool name for the project. I'm working on a pure clojure, coding environment. Some of the goals are:
• strong support for direct manipulation
• create programs incrementally and reduce burden on your working memory
• run everything local and in-process
• leverage the full capabilities of jvm clojure and ecosystem
• make the leap from text editing to code editing
It's still a work in progress. I gave a short demo at one of the visual tools meetings: https://youtu.be/tse4gKFj45c?t=2585#2022-05-1417:20genekim@U7RJTCH6J Holy cow. That is freaking incredible!! I feel like you are definitely onto something amazing.
This moment blew my mind, when you talked about feeling like this is one level closer to your code, than even being in the REPL.
“Imagine not being able to work in a REPL. That's how I'm starting to feel about working in this environment, if i has to go back to a regular REPL.”
And to do it all within your membrane environment, inside the JVM. No browser. It's really 🤯🔥#2022-04-2510:20BayeHi. How do you open IntelliJ on Terminal such as "code ." for opening vscode?#2022-04-2706:15onetomI usually manage my IDE versions with JetBrains Toolbox, which I install with brew install --cask jetbrains-toolbox
That toolbox app can let you turn on the creation of those command-line launcher scripts, like idea.
I usually have an EAP version installed too, so I set in the toolbox to call the script for that idea-eap.#2022-04-2511:33aratarethere's a command called idea but iirc you will have to install it#2022-04-2511:35aratarehttps://www.jetbrains.com/help/idea/working-with-the-ide-features-from-command-line.html#2022-04-2823:06BayeI am still struggling to make it work#2022-04-2905:32aratareWhat was your original intention?#2022-04-2917:35Bayeopen my project from the terminal type "idea ." like one can do vscode or atom "code ." or "atom ."#2022-05-0217:25aratareI haven't tried it so I'm not sure if it works similarly#2022-04-2520:42UlisesMACHi all!
Does anybody know how to display the cursive/diff feature in a shadow repl?
I can use it before using the shadow-cljs REPL but I get the next error:
(shadow/nrepl-select :app)
To quit, type: :cljs/quit
=> [:selected :app]
(cursive/diff "a" "b")
------ WARNING - :undeclared-ns ------------------------------------------------
Resource: <eval>:1:2
No such namespace: cursive, could not locate cursive.cljs, cursive.cljc, or JavaScript source providing "cursive"
--------------------------------------------------------------------------------
------ WARNING - :undeclared-var -----------------------------------------------
Resource: <eval>:1:2
Use of undeclared Var cursive/diff
--------------------------------------------------------------------------------
=> nil
#2022-04-2521:23cflemingIn the release notes there’s a workaround detailed, using a tagged literal: https://groups.google.com/g/cursive/c/djESICRaiHs/m/l1ZVtyxbBgAJ#2022-04-2614:28UlisesMACThanks! :)#2022-04-2520:43UlisesMACI think that a fix could be to put the full namespace (not only cursive )#2022-04-2600:25BayeHi. can I turnoff "symbol" abbreviation in Cursive: instead of F I want defn, instead of ∀ I want doseq...#2022-04-2600:26cflemingCursive doesn’t do that, do you have another plugin installed which does that?#2022-04-2607:18imreOh, I want to hear what that plugin is#2022-04-2608:24cflemingI guess they’re ligatures, which is a built-in feature these days: https://www.jetbrains.com/webstorm/guide/tips/font-ligatures/. But there are still things like this around: https://plugins.jetbrains.com/plugin/14736-ligatures-limited#2022-04-2608:24cflemingI have a feeling there was also a more Clojure-specific one, but I can’t find it now.#2022-04-2611:01xcenoI think you mean this one: https://plugins.jetbrains.com/plugin/8224-clojure-pretty-symbol#2022-04-2611:25imreThank you.#2022-04-2612:29BayeI am not aware that I am using some other plug in, will double check now...#2022-04-2612:39Bayeyeah it was clojure pretty symbol doing it...Thanks#2022-04-2608:52Ernesto GarciaHi. This weekend I tried to work with Intellij + Cursive on Windows, on a project in the WSL (Windows Subsystem for Linux). Cursive seemed to be running tools.deps on Windows, and it failed if I had a git dependency in deps.edn. Would there be a way for Cursive to run tools.deps on WSL2? From what I saw, Intellij is running Maven and Git on WSL2 for such projects.#2022-04-2622:02nottmeyHi everyone, I have a deps.edn alias :test and when running it with clj -M:test it executes all tests, but when I configure it in Cursive, it only executes some of them 😕
{:paths ["src"]
:deps {com.datomic/client-api {:mvn/version "1.0.58"}
com.hyperfiddle/rcf {:mvn/version "20220405"}
com.walmartlabs/lacinia {:mvn/version "1.1"}
org.clojure/clojure {:mvn/version "1.11.1"}}
:aliases {:repl {:extra-paths ["dev"]}
:test {:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.0" :git/sha "b3fd0d2"}}
:main-opts ["-m" "cognitect.test-runner" "-d" "src" "-d" "test" "-r" "datomic-lacinia.*"]
:exec-fn cognitect.test-runner.api/test
:jvm-opts ["-Dhyperfiddle.rcf.generate-tests=true"]}}}
Does anyone have any advice on how to achieve the same behavior?#2022-04-2623:24cflemingAll those tests are in that module under the test folder, correct? I can’t see any reason why they wouldn’t be found. Is this a public project I could look at?#2022-04-2707:02nottmeythe schema-test is in the test folder, the rest ist in the src folder as https://github.com/hyperfiddle/rcf macros next to the implementation#2022-04-2707:03nottmeythe repo ist not public yet, but will be in the next days, I’ll let you know#2022-04-2707:57imreI'm not convinced Cursive is able to discover those rcf tests#2022-04-2707:57imrehttps://cursive-ide.com/userguide/testing.html says Currently the test integration only supports the default clojure.test#2022-04-2708:18nottmeyok, fair point, rcf interacts with clojure.test, but if it actually generates clojure tests like deftest does, i don’t know#2022-04-2708:22nottmeyI guess I need to try with an own test macros what’s possible#2022-04-2708:29cflemingI haven’t tried with rcf, but Dustin is a Cursive user, or at least was for a long time.#2022-04-2708:30cflemingBut I suspect that it might only look for tests under test roots, not source roots - I’d have to check the code for that though.#2022-04-2708:40nottmeyok, I could test that hypothesis first (in my evening), if checking the code is too tedious#2022-04-2715:23Dustin GetzRCF macroexpands to deftest when a JVM flag is set, i don't see why Cursive shouldn't pick it up, the theory about Cursive not looking in src directory makes the most sense to me#2022-04-2715:24imre> JVM flag is set
curious#2022-04-2715:26Dustin GetzIt was not our intended use case to integrate with clojure.test at dev time, RCF is meant to be used at the REPL like rich comment forms, the deftest generation is meant for CI use case (to get test runners, reporters, coverage plugins etc). However we've gotten a bit of feedback that people want to integrate RCF into their old workflows. So we may support that officially in the future#2022-04-2719:44nottmeyyea, I see why it’s no direct concern, because the main usecases CI and REPL are covered.
I would still argue that it would feel very natural to have them show up next to the “normal” tests (where people will still likely implement long running or integration tests). It would also be handy for them to be respected in coverage report of the IDE, so that one could easily add tests where coverage is missing. But I’m still very happy without this working, so no worries.
For now I’m going to test whether deftests in src will be picked up, and whether rcf tests in test will be picked up.#2022-04-2720:12nottmeyOk, RCF tests are picked up in test folder by cursive, but fail. (They succeed when run with clj -M:test ; for config, see above.)
(tests ; in my case schema_test.clj line 8
"true is true"
true := true)
Testing datomic-lacinia.schema-test
.java.lang.ClassCastException: class java.lang.String cannot be cast to class clojure.lang.Symbol (java.lang.String is in module java.base of loader 'bootstrap'; clojure.lang.Symbol is in unnamed module of loader 'app')
at clojure.core$find_ns.invokeStatic (core.clj:4127)
clojure.core$the_ns.invokeStatic (core.clj:4161)
clojure.core$ns_name.invokeStatic (core.clj:4165)
clojure.core$ns_name.invoke (core.clj:4165)
cursive.tests.runner$eval577$report__22180__auto____584.invoke (run-tests8310960651276941006.clj:81)
clojure.test$do_report.invokeStatic (test.clj:357)
clojure.test$do_report.invoke (test.clj:351)
datomic_lacinia.schema_test$fn__557.invokeStatic (schema_test.clj:8)
datomic_lacinia.schema_test/fn (schema_test.clj:8)
clojure.test$test_var$fn__9856.invoke (test.clj:717)
...#2022-04-2720:15nottmeyInteresting, when I add one deftest to a src namespace, the test is picked up and RCF tests are also run#2022-04-2720:39nottmeyI like how interactive RCF feels, but I see that simply using deftest next to the implementation in src can feel pretty similar.
My solution:
(deftest- uppercase-first-test
(is (= (uppercase-first "hellO") "HellO"))
(is (= (uppercase-first "s") "S"))
(is (= (uppercase-first "S") "S"))
(is (= (uppercase-first "") ""))
(is (= (uppercase-first nil) nil)))
;; instead of
(tests
(lowercase-first "HellO") := "hellO"
(lowercase-first "S") := "s"
(lowercase-first "s") := "s"
(lowercase-first "") := ""
(lowercase-first nil) := nil)
And a REPL Command:#2022-04-2722:02cflemingThat exception looks like a bug in Cursive, could you file an issue for that one and I’ll look at it?#2022-04-2722:07nottmeyyes, I can, will do 🙂#2022-04-2723:13nottmeyfyi https://github.com/cursive-ide/cursive/issues/2686#2022-04-2723:30cflemingGreat, thank you!#2022-04-2707:11nodenameHello, I have a little problem with a core.async reference in my code. I have core.async in my project.clj :dependencies, and all my core.async API calls are working fine. But in one file I have:
#?(:clj (:import (clojure.core.async.impl.channels ManyToManyChannel)))
and when I start up a debug REPL, sometimes it is fine, and sometimes I get a ClassNotFoundException!
Not sure if this is something specific to Cursive but ???#2022-04-2708:34onetomIs there a way to reduce the number of spelling mistake markers to more relevant ones?
I think Cursive should consider symbols and keywords, from the libraries a Clojure IntelliJ module depend on, spelled correctly, since we can't do anything about those (unless they are pointing to our code via :local/root)
That way, we can't easily introduce typos into the new code we are writing anew, but we won't be bothered by the choices of the library developers whos' libs we depend on.
Similarly, in deps.edn there is no reason to spell-check artifact names, like lambdaisland/kaocha-junit-xml or com.hyperfiddle/rcf.
In fact, those should probably contribute to the spelling dictionary automatically too.
Eg. I have the following alias in deps.edn:
:ci.run/test
{:extra-deps {lambdaisland/kaocha-junit-xml {:mvn/version "0.0.76"}}
:main-opts ["-m" "kaocha.runner" "--plugin" "junit-xml"]}
and these words are underlined:
• lambdaisland
• kaocha, twice!
1. in the maven artifact name
2. in the 2nd arg of :main-opts
while nothing should be underlined.#2022-04-2708:35cflemingPossibly, I haven’t checked to see if there’s a way to programmatically specify exceptions - I assume so. Could you file an issue with your exception cases, please, and I’ll look at it?#2022-04-2804:27salamColin, the keyboard shortcut for the REPL window (E) in the Switcher (Control-Tab) seems to be case-sensitive. in other words, when Caps Locks is off, Shift-E works but E doesn't.#2022-04-2805:52cflemingThat’s very odd.#2022-04-2806:10cflemingI’ll take a look at this tomorrow, but I don’t think there’s much that I can do about this on the Cursive side, since that’s all IntelliJ.#2022-04-2810:18onetomneither e or E switches anywhere for me under IntelliJ 2022.1, JBR 17.0.2+8-315.1-nomod & Cursive 1.12.3-2022.1 under macOS.
i've activated the Switcher via the Cmd-Shift-A action menu and I indeed saw, there is a capital E, next to the REPL entry.
btw, in Cmd-E (Recent Files action), when I selected the REPL item, also nothing happened; I've stayed in the current editor tab.
after some clicking around, suddenly both approaches started to work and focus the REPL tool window from the Switcher (activated via the action menu), when I pressed the lower-case e.
though they focus the output pane, not the input pane, or the one which was focused the last time.
not sure if that's the intended behaviour.#2022-04-2805:52cfleminghttps://twitter.com/CursiveIDE/status/1519554360342159360#2022-04-2807:43imreThank you, Colin! Does this version have any differences from 1.12.3-eap2 ?#2022-04-2808:26cflemingNo, it’s just released in the main stable channel, so that everyone not signed up for EAPs will get it too.#2022-04-2808:27cflemingFor those on the EAP channel there’s no change.#2022-04-2808:47imreThanks for the info!#2022-04-2811:05akielThanks for the new release! I have now a problem running a REPL from by deps test alias that includes a
:main-opts ["-m" "kaocha.runner"]
It seems to have something to do with https://github.com/cursive-ide/cursive/issues/2322
Kaocha is complaining Unknown option: "-i".
> Cursive now adds them prior to the -i option,
If I remove the Kaocha main-opts, it works. Should I have a separate test-repl alias?#2022-04-2811:09imre@U07MC8H4Z I experienced this with -eap2 a day or two back. For me it only affects repl configs that are set to run with deps so I worked around it by selecting run with intellij project classpath and selecting the aliases I need in the deps tool window#2022-04-2811:15akiel@U1ZD6QX4G Thanks. I don't know if using the intellij project classpath is the best solution. I just separated my test und kaocha dependencies and use only the test alias for the REPL and test+kaocha for the CI. Seem more clear to me to use two separate aliases. What do you think?#2022-04-2811:17imreWhatever works for you 🙂 my case was a little different, I wanted to stay with a single alias#2022-05-0306:16imreAdded a comment on https://github.com/cursive-ide/cursive/issues/2322#issuecomment-1115769457 - I think main-opts could use a bit more thinking. Afaik :main-opts is a clojure.main thing, not an nrepl one anyway?#2022-05-0306:17cflemingYes, it does need more thought. I have to say I find the deps aliases super confusing, I haven’t managed to make a coherent mental model of them at all.#2022-05-0306:18cflemingThey started out quite simple, but now are not, and that’s going to make the UI for running things via deps tricky - I was thinking about it the other day.#2022-05-0307:54imreWithout knowing how difficult this part is in Cursive, I'd try and lean on tools.deps as much as possible so stuff works preferably the same way outside of Cursive as inside of it#2022-05-0308:04cflemingYeah, that’s my plan.#2022-05-0308:10imredeps is confusing sometimes. I find it useful to create minimal projects to try some aspects of it out like https://github.com/imrekoszo/try-deps-tool-replace#2022-05-0308:13akielAren't aliases just named parts of config that are merged together depending on what aliases one selects?#2022-05-0308:16cflemingNot any more. Depending on the flag you use, the config is merged in different ways. For example, using -T deps will use a completely different classpath.#2022-05-0308:22imreI don't think it's that serious - -T just implies an extra 'alias' containing :replace-deps {} :replace-paths ["."]#2022-05-0308:23imreThe repo I linked shows these#2022-04-2907:56onetomam I not supposed to get an "intention" when I press Opt+Enter on a qualified keyword, which uses a namespace alias (eg. ::anom/fault), to require that namespace with the corresponding :as clause?
maybe im not getting such an option, because the alias is ambiguous?#2022-04-2907:57onetomit's quite tiring to keep requiring this cognitect.anomalies NS 🙂#2022-04-2908:51octahedrionI went to paste some core.async code having a < in it and this popped up#2022-04-2909:13cflemingYes, the detection seems a little aggressive sometimes.#2022-04-2909:25octahedrionfound it#2022-04-2909:27octahedrionI think it would be better to offer a special paste-as-hiccup operation that can be bound to a keyboard shortcut as desired#2022-04-2917:18onetomC-u Cmd-V 🙂#2022-04-2920:50cflemingI think discoverability of a special command would be far worse, and the detection doesn’t mess up that frequently (and could definitely be improved).#2022-05-0414:06octahedrionbut I had to discover how to disable it#2022-05-0421:37cflemingWell, you can also always just click the “Paste Normally” button, right? How often does this happen?#2022-04-2917:03Jakub Holý (HolyJak)It seems Cursive doesn't deal well with assertions when they are not in a test but in a function called from the test (in my case it is even in another ns). No indication the fn "failed" or that the assertion in the fn (test/is) failed#2022-04-2920:54cflemingYes, that’s https://github.com/cursive-ide/cursive/issues/823. I’ll see if I can look at that soon, I’m planning some work on the test integration.#2022-04-3008:27Jakub Holý (HolyJak)awesome, thx!#2022-05-0119:11BayeHi. are there "dot" files for Cursive that one can copy for one's setup?#2022-05-0317:33serioga@U01BDCAV7NZ there are some IDEA's files, like here https://github.com/serioga/webapp-clojure-2020/tree/master/.idea#2022-05-0322:18BayeThanks, will check it out#2022-05-0323:56onetomSome more useful settings from our project:
.idea/ClojureProjectResolveSettings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ClojureProjectResolveSettings">
<item key="com.rpl.specter/cond-path" resolves-as="clojure.core/cond" />
<item key="com.rpl.specter/defcollector" resolves-as="clojure.core/defn" />
<item key="state-flow.api/flow" resolves-as="clojure.test/testing" />
<item key="state-flow.api/for" resolves-as="clojure.core/for" />
<item key="richelieu.core/defadvice" resolves-as="clojure.core/defn" />
<item key="clojure.spec.alpha/fdef" resolves-as="clojure.core/def" />
<item key="clojure.template/do-template" resolves-as="clojure.test/are" />
<item key="com.rpl.specter/defdynamicnav" resolves-as="clojure.core/defn" />
<item key="com.rpl.specter/defnav" resolves-as="clojure.core/defn" />
<item key="com.rpl.specter/defrichnav" resolves-as="clojure.core/defn" />
<item key="com.rpl.specter/defmacroalias" resolves-as="clojure.core/def" />
<item key="state-flow.api/defflow" resolves-as="clojure.test/deftest" />
<item key="clojure.core.match/match" resolves-as="clojure.core/case" />
<item key="com.rpl.specter/if-path" resolves-as="clojure.core/if" />
<item key="clojure.core/defonce" resolves-as="clojure.core/def" />
<currentScheme>PROJECT</currentScheme>
</component>
</project>
.idea/codeStyles/Project.xml:
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="RIGHT_MARGIN" value="100" />
<option name="SOFT_MARGINS" value="80" />
<ClojureCodeStyleSettings>
<option name="commentAlignColumn" value="40" />
<option name="keepNsSorted" value="false" />
<option name="indentCustomisations">
<map>
<entry key="clojure.core.match/match" value="-1" />
</map>
</option>
</ClojureCodeStyleSettings>
<codeStyleSettings language="CSS">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Markdown">
<option name="RIGHT_MARGIN" value="80" />
</codeStyleSettings>
</code_scheme>
</component>#2022-05-0500:07BayeThank you for sharing#2022-05-0120:58roklenarcicHow can I REPL into a tools alias? I tried starting a REPL with a tools alias selected in the deps menu and the dependencies are not added to classpath#2022-05-0122:48cflemingThat’s https://github.com/cursive-ide/cursive/issues/2653, which will hopefully be in the next EAP build.#2022-05-0306:31roklenarcicthanks#2022-05-0212:36imreAnyone had a problem with replace-deps in aliases recently? Cursive doesn't appear to see the ones specified like that for me#2022-05-0212:37imreIf I change it to extra-deps and refresh the project, they show up among Dependencies and I can navigate to those namespaces, but not with replace-deps#2022-05-0212:38imreIntelliJ IDEA 2022.1 (Community Edition)
Build #IC-221.5080.210, built on April 12, 2022
Runtime version: 11.0.14.1+1-b2043.25 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.3.1
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 8
Registry:
scala.erase.compiler.process.jdk.once=false
Non-Bundled Plugins:
... com.cursiveclojure.cursive (1.12.3-2022.1)#2022-05-0306:03imre@U0567Q30W does this ring a bell or should I create an issue?#2022-05-0306:06cfleming@U08BJGV6E Could you file an issue please? That doesn’t ring a bell, and I can’t find anything like it.#2022-05-0306:11imreSure thing will do later#2022-05-0308:36imreOpened https://github.com/cursive-ide/cursive/issues/2689#2022-05-0214:24Marko VukovicHi everyone, is it possible to eval a from in the repl and then jump to the next form?#2022-05-0214:25imreThis should be macroable using intellij macros#2022-05-0323:58onetomi'd be interested to see such a macro!
i tried to use intellij macros for the 1st time a few weeks ago and they just didn't work as expected, AT ALL. 😞#2022-05-0400:04onetomanother useful feature would be to clone the current top-level form, keep the cursor where it was, so we can start modifying the form, without loosing its previous "version".
this would result in a REPL workflow, which is more similar to working from a unix shell, which is not too bad, imho...
eshell can be configured to work almost this way. looking at my config, probably these lines activate this special behaviour for eshell:
(require 'em-smart)
(add-to-list 'eshell-modules-list 'eshell-smart)
#2022-05-0411:20imreto record:
1. place caret at the end of form to eval
2. start recording macro
3. eval sexp before caret
4. paredit-forward
5. stop macro recording
to use:
1. caret at end of form to eval
2. execute eval-move macro#2022-05-0214:41kennyHas anyone noticed that when using the Cursive clojure.test integration, if you hover a large, failing test, it will completely freeze your UI? It's a really frustrating behavior. I often find myself really trying to avoid putting my mouse on the red squiggly, else I'll lose several seconds to a full ide lockup.#2022-05-0214:49imreit's a known issue, there are several related open issues: https://github.com/cursive-ide/cursive/issues?q=is%3Aissue+is%3Aopen+hover#2022-05-0214:49kennyk#2022-05-0223:09wilkerlucioyes, I feel you, a thing that helps is using Clear all test markers to avoid the mouse dance around the failures#2022-05-0223:09kennyThat unfortunately hides the button to open the diff viewer 😞 got a workaround for that one? #2022-05-0223:10wilkerlucioin this case the mouse dance still required, to get the mouse in the marker without hovering the failure#2022-05-0223:25cflemingSorry, I’m planning to do some work on this soon, I’ll put that in the current EAP series.#2022-05-0223:26kennyThat would be huge! Thank you!!#2022-05-0223:57cflemingIt’s not quite clear what the best thing to do is when the output is really big. My plan is to print the current output, then if that’s too big then diff the results and print some kind of diff, and if that’s too big then fall back to “x changes in y top-level keys” or something like that. Does that sound reasonable?#2022-05-0223:58kennyPrint where?#2022-05-0223:58cflemingIn the tooltip.#2022-05-0223:58wilkerluciois there a way to know the size quickly? one option is to disable the hover tip with the result#2022-05-0223:59wilkerlucioa simple dummer solution is to have a config option to disable the tooltip result entirely (getting it only by opening the diff)#2022-05-0223:59cflemingYes, perhaps the hover tip could just show a summary like “x changes in y keys” or something. I pretty much immediately go for the diff anyway. But it might be helpful to see “x changes under keys :foo, :bar and :baz” or something similar.#2022-05-0300:00kennyfwiw, I never use the hover, so would be totally ok with it gone.#2022-05-0300:00wilkerlucioabout the test, in cases where clojure can't determine the actual/expected, currently when clicking for the diff nothing happens, can we instead have a window with the raw result?#2022-05-0300:00cflemingI’ll look at that, sure.#2022-05-0300:01cflemingActually, could you file an issue for that just so I don’t forget?#2022-05-0300:01wilkerluciosure#2022-05-0300:33wilkerluciohttps://github.com/cursive-ide/cursive/issues/2687#2022-05-0300:34cflemingThanks - is that check macro from matcher combinators?#2022-05-0300:35wilkerlucioit uses matcher combinators under the hood, you can get check from: https://gitlab.com/mauricioszabo/check#2022-05-0300:35cflemingThanks, I’ll add that to the repro case.#2022-05-0300:36kennyThe match? macro from the matches combinators lib is the main one where this comes up for me. #2022-05-0300:36cflemingOk, I’ll check that one too.#2022-05-0300:41wilkerlucioI think the way to handle those should be the same down the line, unless you are going to give it some specialised implementation#2022-05-0305:57imreThere's alsonthe case when something (like a clojure.test/are or clojure.template/do-template) results in something passing a number of times and failing some times#2022-05-0305:58cflemingYes, that needs a list popup when clicking on the gutter icon.#2022-05-0305:58cflemingI’m not sure if there’s an issue for that one, but that annoys me regularly so I won’t forget about it 🙂#2022-05-0306:01imreMy 2 priorities are keyboard navigability even if I have the gutter hidden and that it doesn't make the ui hang. Wondering if the intention could offer an action to put the fails into a tool window? Might be an overkill though#2022-05-0306:04cflemingYes, there’s an issue for the keyboard thing but I can’t find it right now.#2022-05-0306:05imrehttps://github.com/cursive-ide/cursive/issues/2229 is an example#2022-05-0306:05cflemingAh, yes, thanks.#2022-05-0400:24onetomim thinking about a better REPL flow for awhile.
here is what i came up with so far:
1. use special REPL files for establishing and working with various contexts of a bigger application, eg. one file per 3rd-party API, database, http layer, etc
2. most REPL files are probably development only and contain destructive operations, which is don't want to execute accidentally in a production Clojure process, so they should live under a directory, eg. <project-root>/dev/, so they are not deployed to production.
3. we should use file-based evaluation, NOT buffer-based, by default, so we can't accidentally load such code through a production REPL
4. the namespaces for these REPL files should be shallow, in case we need to type their names out manually. eg. project.name.datomic-repl (which would reside in dev/project/name/datomic-repl.clj)
5. the x.y.datomic-repl.clj naming scheme - as opposed to x.y.datomic.repl.clj - helps to distinguish multiple REPL files being open in various editors, which might chop off, abbreviate or display with a pale color the x.y.datomic part.
6. we should use rich-comments in such REPL files, so we can just reload them any time without side-effects.
and here is the workflow part (position of the caret shown as •):
1. start with this:
(comment
(-> *1•)
)
where *1 is highlighted.
we edit this form:
(comment
(-> some-seq
(doto pprint)
(->> (map :some/key•)
(keep :other/key)))
)
then eval it and i'd expect a copy of the evaluated form appear above the form itself and my cursor stay in place:
(comment
(-> some-seq
(doto pprint)
(->> (map :some/key)
(keep :other/key)))
(-> some-seq
(doto pprint)
(->> (map :some/key•)
(keep :other/key)))
)
so i can keep iterating on the form, while maintaining a history of its evolution, which i can clean up later.
i'd also expect the undo operation to remove the copied form, in case im just repeating the same operation for its side-effect.
eg. maybe im just polling something manually.#2022-05-0400:28cflemingSomewhat related, one thing I’ve thought of recently which I think would be really useful, similar to https://github.com/cursive-ide/cursive/issues/2623. I’d like a command to be able to execute a rich-comment form from anywhere in the file. So probably a command which pops up a searchable list of all the comment-commands in the current file, and allows me to execute them.#2022-05-0400:29onetomother useful approach which has emerged in my usage is this form:
(comment
@(def some-var *1)
@(def some-var
(-> (some computation) (print-summary)))
)
so i can see the result of the computation, while also capturing it#2022-05-0400:30cflemingInteresting idea.#2022-05-0400:33onetom@U0567Q30W yes, that bookmarked evaluation is also a great building block, i've just realized in the last 2-3days.
i often need to modify some function definition in an NS and re-run a form in another NS, to test out the effect of my change.
so far im just using the Re-execute last command option of a Cursive REPL Command, but the last action gets overwritten, when I execute another Cursive REPL Command.#2022-05-0400:35cflemingYes, definitely, I’ve been feeling that recently too.#2022-05-0611:26JAtkinsA while back I used a "save command" repl command that saved the text of your current editor selection and your current ns. Was able to run that code again in the future from any context. It's super useful, and it'd be nice to have some more official support for something like that#2022-05-0416:46BayeHi. How do you get "on the same line" repl eval on Cursive?#2022-05-0416:52imreCursive doesn't provide that, but there's another plugin on top of Cursive that does: see #clj-extras-plugin#2022-05-0417:03BayeThanks!#2022-05-0510:03mhuebertJust added my thumbs-up to this issue - https://github.com/cursive-ide/cursive/issues/2690 - it should be possible to have cyclic dependencies when using :as-alias, makes repl-ing in these namespaces quite difficult at the moment#2022-05-0522:55cflemingYes, I’m sorry about that one, I’ll fix that for the next build.#2022-05-0618:11nottmeyHow can I set the clojure language version to 1.10? I’m writing a library and I keep using functions which are not available in older clojure version 🙈 (e.g. update-vals and update-keys)#2022-05-0618:26Alex Miller (Clojure team)those are actually in Clojure 1.11.1, but you just need to set that as your Clojure dependency for the project - how will depend on whether you are using project.clj, pom.xml, or deps.edn#2022-05-0618:31nottmeyI use deps.edn, so I just add org.clojure/clojure {:mvn/version "1.10.3"} to my :deps ? Doesn’t this bother someone who want’s to use my library with Clojure 1.11.1?#2022-05-0618:55imreIt shouldn't#2022-05-0618:57nottmeyHmm, ok 😄#2022-05-0618:57imreBut you can also put it in a dev alias for example#2022-05-0618:58imreJust make sure you tick that alias in the deps tool window in cursive#2022-05-0618:57folconHmm, would it be possible that when a file reload is triggered that if parinfer is enabled it's temporarily disabled or something?
I find when >>>>>>> from git conflicts occur, recovering what your s-expressions used to look like is sometimes really problematic?#2022-05-0918:50gravActually made an issue about this a while ago 🙂
https://github.com/cursive-ide/cursive/issues/2505#2022-05-1017:37kennytiltonSo I type (try and then hit return and now my code looks like this:
(when-let [^State state (:state-ref (meta me))]
((try
(catch Exception e
))(.setState state (fn [] (do)))))
Kinda cool because I always struggle to remember all that, but...why is that happening? Is cursive doing that, or do I have some unknown plugin doing that?
Anyone know how to make this stop? Thx!#2022-05-1018:24isakIt is probably this:#2022-05-1018:25isakBut on mine the default is it expands with TAB, not Enter, so I wonder why it is doing that for you if you haven't changed it#2022-05-1022:33cflemingYes, that sounds like the live template. I’ve actually found them expanding unexpectedly recently too, what I suspect is happening is that IntelliJ is adding them to the autocomplete, and you have to pay attention to see whether what’s being completed is the symbol (e.g. try) or the live template.#2022-05-1209:01kennytiltonFinally dug into this and tested a bit. I do get the expansion on both tab and return, tho the setting si for tab. Anyway, not a feature I need so I just turned it off.
Thx for the pointer to the relevant pref, @U08JKUHA9! 🙏#2022-05-1108:54danmWe're seeing behaviour where if there is a long running process in the REPL (particularly if it's attempting to connect to some remote and and waiting for a timeout), IntelliJ as a whole seems to lock up. Specifically the terminal built into IntelliJ stops accepting input. Is this a known issue?#2022-05-1401:03AJ JaroNo, I haven't experienced this before. I've had things run for over 10 minutes but I don't know what kind of "long" you mean#2022-05-1116:31ingesolWe have a monorepo tools.deps project where each sub-project is loaded as a module in Cursive. As an example, Module A uses functions from Module B. But “Find usages” on a function in Module B does not find usages in Module A, only internally in Module B. Is this supposed to work across modules?#2022-05-1117:06imreIs this a polylith project by any chance?#2022-05-1117:21imrehttps://github.com/cursive-ide/cursive/issues/2554 whether or not it is, it is probably related to the cause of the linked issue and the workaround could be similar#2022-05-1121:21ingesolNot polylith. And sorry, forgot to mention one important fact: Module B is a dependency of Module A by using :local/root. I suppose that’s the main reason, that Module A knows how to find Module B, but not the other way around.#2022-05-1122:10cflemingYes, dependencies normally only work in one direction. Is there a reason code in B should be able to access A?#2022-05-1123:32danielcomptonTo more concrete, we have an “app” module and a “lib” module. app depends on lib via :local/root. When doing find usages on a function in lib, it only shows other uses in lib, not the uses in app#2022-05-1220:21cflemingI see, thanks - I’ll take a look at that.#2022-05-1121:21ingesolNot polylith. And sorry, forgot to mention one important fact: Module B is a dependency of Module A by using :local/root. I suppose that’s the main reason, that Module A knows how to find Module B, but not the other way around.#2022-05-1123:35folconWhat controls how much indentation auto-format lines adds to comments?
Both ; and #_ tend to move with added spacing and all it seems to do is break parinfer...#2022-05-1621:16cflemingThis shouldn’t break parinfer, could you give an example of each?#2022-05-1711:09folconI'll PM you?#2022-05-1800:00cflemingThanks!#2022-05-1305:11Nom Nom MousseAfter I use load-file I do not see any autocompletion for the loaded namespace in the REPL. Like I load-file
(ns rules)
(def cursive "is great")
and there is no autocomplete for rules/cursive afterward. Is this something you might consider adding?#2022-05-1322:52cflemingThat should definitely work, I’ll check it when I’m back at my computer.#2022-05-1409:26Nom Nom MoussePerhaps it has to do with my project code or setup then.#2022-05-2011:05onetom@U0232JK38BZ u should have a module defined for your clojure project as either a Clojure / Leiningen or Clojure / Deps type.
you should check out the Cursive User Guide on the topic:
https://cursive-ide.com/userguide/first-repl.html
also the next, BUILD TOOLS section is useful to really understand what's all this extra complexity is about.
eg, the section about using deps.edn file based Clojure projects is what you want to learn probably:
https://cursive-ide.com/userguide/deps.html#2022-05-2011:15Nom Nom MousseThanks, I'll look into it.
Perhaps part of the problem is that my file is not on the classpath. I evaluate the ns myself with load-file.#2022-05-1617:25salamColin, can you please add the ability for Cursive to pick up a socket REPL port from a file in the Edit Configuration Settings window? similar to the “Use port from nREPL file” option for nREPL or a more generalized version of it? i know there’s not a similar standard for socket REPL yet but this is going to be really handy with tools that provide such files (e.g., shadow-cljs writes the socket REPL port to a file named .shadow-cljs/socket-repl.port) thanks in advance!#2022-05-1621:15cflemingSure, I filed https://github.com/cursive-ide/cursive/issues/2695 and will get it done in this EAP series.#2022-05-2010:57onetomIntelliJ 2022.2 EAP feels significantly snappier than 2022.1.1!
@cfleming any estimate, when can you release a Cursive version for it?#2022-05-2011:10onetomi was trying to use recent EAP and non-EAP versions of IntelliJ with an M1/ARM version of JBR17 from 2022 February and the only issue I've experienced with Cursive, was related to some SVG rendering, if I understood correctly.#2022-05-2011:11onetombut i might have just imagined that and it was actually related to the new Vector API, which i just saw being mentioned in https://blog.jetbrains.com/idea/2022/05/intellij-idea-2022-2-eap-1/#2022-05-2019:18imrenice#2022-05-2019:18imrewould love to upgrade to this#2022-05-2021:01cflemingI’ll get on it 🙂#2022-05-2110:34cflemingOut now!#2022-05-2110:34cfleminghttps://twitter.com/CursiveIDE/status/1527960614215495680#2022-05-2110:39imreImpressive changelog!#2022-05-2110:39cflemingThat one has been a while in the making!#2022-05-2110:39cflemingThere’s lots of behind-the-scenes changes there too, which will no doubt result in new and exciting bugs 🙂#2022-05-2316:24thumbnailThanks for this one! I’ve been trying it out and it’s working well so far ⚡!
I noticed there’s some sort of ‘git lens’-feature added to IntelliJ which works at least for Ruby; is something we could support for clojure too?#2022-05-2320:44cflemingI’m not sure what that is, do you have a screenshot of it or a description of how it works?#2022-05-2321:21bedersand IJ feels snappier on MacOS indeed#2022-05-2408:31thumbnailsure thing! Here you go:
If I click my name there, it opens the ‘git blame’-panel on the left#2022-05-2408:32cflemingAh, yeah, I looked at this the other day, it’s actually not too tricky. Could you file an issue for this please, and I’ll get it in the next EAP?#2022-05-2506:50thumbnailhttps://github.com/cursive-ide/cursive/issues/2698 there you go 🙂.#2022-05-2315:33chrisbroomeIs there a keyboard shortcut to convert a string to a keyword?#2022-05-2315:45Jordan Robinsonlike shift + ; ?#2022-05-2315:55chrisbroomeThat just puts a : before the string - I want to also get rid of the surrounding double quotes. For example, I want "path" to become :path .#2022-05-2319:42mike_ananevTry “String manipulation” plugin.#2022-05-2412:47chrisbroomeI don't see this option int he key bindings section#2022-05-2320:47cflemingIn case anyone is feeling brave: https://blog.jetbrains.com/idea/2022/05/take-part-in-the-new-ui-preview-for-your-jetbrains-ide/#2022-05-2408:49imresigning up#2022-05-2408:50imrehave you tried it yourself, or has it not started to roll out yet?#2022-05-2408:50cflemingI’ve signed up for it to see how Cursive works with it, but I haven’t heard back yet.#2022-05-2408:50imreoh, and have you any info on fleet? are you planning to support it?#2022-05-2408:51cflemingPersonally I’m a fan of default everything, so I doubt I’ll use it, but I’d like to kick the tyres.#2022-05-2408:53cflemingNot much is known about Fleet yet. Supporting it will probably be a pretty major rewrite, so I’m not sure whether that will happen or not.#2022-05-2408:53cflemingThere’s no information for plugin devs yet, really.#2022-05-2408:53imregotcha, thanks for the insight#2022-05-2408:55imreI'm looking forward to anything that can make intellij (or fleet) work better as a general editor in addition to being a great Clojure ide#2022-05-2408:55cflemingFor myself, I think I’d use fleet as a general editor which will feel more familiar, but not as my main driver.#2022-05-2408:56cflemingBut maybe it will surprise me. Currently I use Sublime Text, which is nice but feels weird when I’m so used to IntelliJ. I expect Fleet to feel much more familiar.#2022-05-2408:59imreYeah I'm also running sublime for some general stuff. I envy those who can stay in their favourite editor the entire time but I'm not prepared to give Cursive up so I'm hoping Cursive and its host ide(s) will move in a direction that enables me to ditch everything else for them#2022-05-2408:59cflemingHave you tried the IntelliJ Light Edit mode?#2022-05-2408:59cflemingIt’s still not what you’d call super light, but better.#2022-05-2409:00cflemingI should probably try to use that more, actually.#2022-05-2409:03imreI have tried it, but unfortunately it isn't light enough and it's still too lean in terms of features. For example I like to write commit messages in an editor with https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---verbose so I see the diff right there. IJ light doesn't highlight stuff in that diff while Sublime but even Micro do.#2022-05-2409:04imreAnd both of those load quicker and much more reliably than IJ LE#2022-05-2409:04cflemingYeah, I can believe that.#2022-05-2409:04imre(I prefer using git from the command line and not via my ide. I would try magit but that's bound to emacs unfortunately)#2022-05-2409:06cflemingI do most of my git from the command line, but I use the Git Toolwindow a lot because the graph is really nice, and makes it easy to see what’s going on. I also do some things from the IDE these days, like checkout+rebase, and updating forks from Github.#2022-05-2409:08imre> checkout+rebase, and updating forks from Github
These are the things I'm probably most uncomfortable trusting the IDE with, partly due to IJ putting its own vocabulary on top of git vocab#2022-05-2409:08cflemingSure, I get that, but I’ve found it convenient and reliable.#2022-05-2409:09imreI do use it for file history and inline annotation and "open on github"#2022-05-2403:46aratareis it just me or that new UI looks similar to vscode?#2022-05-2404:25cflemingYes, soon Cursive will look just like Calva!#2022-05-2412:50chrisbroomeIs there a way to tell cursive to format maps differently? What I'm looking for is instead of this:
(def my-map {
:a 1
:b 2
})
I'd like this:
(def my-map {
:a 1
:b 2
})
So, 2 spaces indent relative to the previous indent instead of 1 space indent relative to the opening curly bracket#2022-05-2412:51imrethat's a rather java/script-y formatting style#2022-05-2412:53imreas far as I know Cursive's indenter works in relation to the containing form (which in the case of the contents of the map would be the curly brackets themselves), not in relation to the previous indentation level#2022-05-2412:53imreI believe most Clojure formatters work in this way#2022-05-2412:54imreIs there any specific reason you are looking to achieve such a clojure-unorthodox style?#2022-05-2412:56chrisbroomepersonal preference i guess#2022-05-2412:57chrisbroomeit's really difficult to get used to this formatting style coming from other languages#2022-05-2412:57imre(def my-map
{:a 1
:b 2})#2022-05-2412:57chrisbroomebut also: if you have nested maps, the indentation can easily pushed off the side of the screen#2022-05-2412:58chrisbroomenested data structures* - not specific to maps#2022-05-2412:58imre(def my-map
{:a 1
:b 2
:c
{:foo 1
:bar 2
:baz
{:qux 1
:quux 2}}})#2022-05-2412:59chrisbroomethat's fine but not gonna lie - the 1 space relative to opening brace just kinda kills me. it makes it very hard to see where the nesting begins/ends#2022-05-2413:01imreWhile I respect your preferences (I also have my own nits here and there) but I think I'd rather suggest that you familiarize yourself with the conventions that are more established in existing codebases, otherwise you might have a hard time reading others code and vice versa (and potentially collaborating with others)#2022-05-2413:01chrisbroomeI suspect I'm not the only clojure user coming from C-syntax-style-languages that feels this way#2022-05-2413:02imreI don't know about any clojure editors that support the style you are trying to achieve so I'd imagine it could feel like pissing against the wind a bit#2022-05-2413:02chrisbroomeyeah... just feels like yet another hurdle to overcome for new Clojure users. but i do agree that if there's a standard I probably should familiarize myself with it#2022-05-2413:03imre#2022-05-2413:04imrewhat you can do to help you judge where forms start and end is set up the matching brace highlighting#2022-05-2413:04chrisbroomealready have that enabled#2022-05-2413:04chrisbroomeappreciate your help though#2022-05-2413:06imreWelcome to the community! I'm sorry I couldn't have better news. If you haven't so far, do also check out paredit/structural editing. Coming from C#, that was the feature that made me never want to go back to editing c-style code ever again#2022-05-2413:08chrisbroomeI use it in a very limited way right now. I love the power/capability, but I do need to learn all the keyboard shortcuts. Honestly Tony Kay's fulcro tutorials have been amazing for seeing what's possible in a "real world" setting using structural editing#2022-05-2413:10imreI found Cursive's keybinds good for the operations I mostly use, which are slurp, barf, raise and splice#2022-05-2416:03cap10morganIs there a workaround for the build.clj is not under a source root issue w/ tools.build when build.clj is in the project root? Or is putting it in a subdir still the best one? Searched back through the channel history and cursive user guide a bit but didn't see anything.#2022-05-2416:05R.A. PorterHave you tried doing this, checking the build tool alias?#2022-05-2416:07cap10morganno, where is that?#2022-05-2416:07R.A. PorterClojure Deps window. By default it should be in the upper right application margin.#2022-05-2416:08cap10morganah, yep. I have that hidden by default. found it though. thanks I'll give that a try!#2022-05-2416:08R.A. PorterYou'll need to hit the refresh icon in that plugin's toolbar after checking the alias.#2022-05-2416:11cap10morganhmm... that fixed the "not under source root" but it still can't resolve the library fns I'm calling from build.clj (e.g. b/uber)#2022-05-2416:13cap10morganoh, but a full restart of intellij fixed that. great! thanks again!#2022-05-2416:13R.A. PorterDoes your build alias in your deps file include the dep for io.github.seancorfield/build-clj?#2022-05-2416:13R.A. PorterAh. Cool. 👍#2022-08-0816:10danmBut I don't in Cursive#2022-08-0816:11danmBut I have to admit I don't understand why, if the REPL server is being loaded with that middleware running, it would not send the output back to the connected Cursive REPL session#2022-08-0817:21danmAhha, asking in #nrepl and I got this https://clojurians.slack.com/archives/C17JYSA3H/p1659976888613829 Looks like I need to work out how to get the nREPL client from within Cursive, and send the out-subscribe message to it. But this is something that is lower level than the REPL I'm used to interacting with, I think. Need to dig more. If I can do it in our user space that'll do for now, though if Cursive would do it automatically if the middleware was loaded, like Emacs does, that would be 🎉#2022-08-0818:18Ivar RefsdalCross post from #nrepl as well, this gist has solved this issue for me (and other people here as well):
https://gist.github.com/daviesian/4517859
nrepl issue: https://github.com/nrepl/nrepl/issues/119#2022-08-0819:21danmI've fixed it with the following, which runs on REPL load because it's in our auto-loaded user ns:
(ns user
(:require [nrepl.core :as nrepl]
[nrepl.misc :refer [uuid]])
(:import ( ConnectException)))
(try
(let [client (-> (nrepl/connect {:host "localhost" :port 4005})
(nrepl/client 1000))]
(nrepl/message client {:id (uuid) :op "out-subscribe"}))
(catch ConnectException _)) ; Don't care if it fails, we're probably not a remote REPL#2022-08-0819:23danmObviously it's a bit hacky, and you'd probably want something cleaner in Cursive proper, if it ran on every REPL start. Probably using the hostname/port provided in the config (I just know ours is always localhost with port forwards, and 4005), and actually checking if the middleware is loaded, like CIDER does, rather than just a try...catch#2022-08-0822:12cflemingOk, thanks for all that investigation! I’ll look at robustifying Cursive there.#2022-08-0822:16cflemingIs it a reasonable assumption that if that middleware is present then the client will always want to subscribe? I’m thinking probably yes.#2022-08-0905:58danmThat certainly seems to be the assumption that CIDER makes#2022-08-0907:45cflemingActually, I’m not sure about that, in this code snippet: https://clojurians.slack.com/archives/C17JYSA3H/p1659977276803309?thread_ts=1659976888.613829&cid=C17JYSA3H#2022-08-0907:45cflemingThe cider-redirect-server-output-to-repl bit looks like a config flag to me - I’ll check that.#2022-08-0909:42danmhttps://github.com/clojure-emacs/cider/blob/9577dbbdae8cffe023442427b97f963b4447983a/cider-connection.el#L329-L330 is where it's called, and https://github.com/clojure-emacs/cider/blob/9577dbbdae8cffe023442427b97f963b4447983a/cider-connection.el#L48-L55 is the definition. So you're definitely right that it's a config flag. I don't know where you'd see any default values. Certainly everyone in the team here who uses CIDER (or vim-fireplace, which also makes use of cider-nrepl extensions) has said "Oh, that Just Works for me", so either it's default true or everyone has cargo culted someone else's config file and never looked into what that option does 😉#2022-08-0922:51cflemingWhich sounds eminently possible 🙂#2022-08-0922:52cflemingHowever dpsutton confirmed over in #nrepl that it’s an opt-out flag, so on by default.#2022-08-0907:19augustlI’m trying out Fleet, the brand new IDE from JetBrains that’s in closed beta. Are there any plans on making Cursive work for Fleet as well as IDEA?#2022-08-0907:35cflemingMaybe, but it’s a totally unknown quantity at this point. There’s no plugin API or information for plugins devs yet, and since the UI framework is totally different it’s likely to be a non-trivial amount of work. It’s a little unclear to me where Fleet sits in JB’s product offering too, and how many people are likely to pay for it.#2022-08-1516:39ozymandias33I have a grandfathered license for all products and will definitely try it out upon release. This feels like a competitor to VS Code. The JetBrains IDEs are standalone versions of IntelliJ features for different languages / environments. In a polyglot world, the feature bloat of IntelliJ and plugin overhead is now an oft recurring headache. However, these features and plugins are robust enough to keep me tied to the platform. I would use Fleet for most editing and navigation if the lightweight mode works well enough. Yet still imagine myself using IntelliJ / Cursive for Clojure work to take advantage of the REPL integration.#2022-08-0912:26d-t-wHey Colin, just dropping in to say that I installed the latest eap of Cursive and I really like the author annotations addition - completely took me by surprise and is a great addition ta!#2022-08-0923:05cflemingNo worries, glad you’re liking it! There are probably a bunch more I can add similar to what’s around for other languages, but they’ll need a little more investigation.#2022-08-0918:17JoelI have a macro that evaluates to a (deftest...) is there a way to have it play friendly with the cursive test support?#2022-08-1106:30olttwaHey @cfleming
Firstly, thank you for creating such an awesome plugin in Cursive.
I'm developing a project Goose: https://github.com/nilenso/goose
Apart from src & test folders, I've created a separate folder for load-testing called perf
I've added perf folder to Source root as can be found in goose.iml
However, upon restart, IntelliJ won't compile with a warning & I've to re-add perf to Source root every time.
> File load.clj is not under a source root
Any idea why IntelliJ does that & how to fix this?#2022-08-1106:31cflemingThanks for the kind words! It looks like goose is a deps project, so you probably want: https://cursive-ide.com/userguide/deps.html#working-with-aliases#2022-08-1106:36olttwa@cfleming I added all aliases in the Clojure Deps toolwindow, added load.clj as source root & restarted IntelliJ.
Still I'm facing same issue.#2022-08-1106:37olttwaI cannot even load the file into REPL despite it being configured in REPL's config#2022-08-1106:38olttwaIt works after I've done Add source root in IntelliJ#2022-08-1107:56cfleming@U03HVBGMRJ5 When you select the aliases in the toolwindow, you don’t have to restart IntelliJ, just refresh the project from the toolwindow. So, could you open the toolwindow and refresh the project now?#2022-08-1107:57cflemingOnce you’ve done that, does the perf folder appear as a source root? It should be the same colour in the project view as the src folder.#2022-08-1110:55olttwa> just refresh the project from the toolwindow
Doing this doesn't fix the issue
> Does the perf folder appear as a source root? It should be the same colour in the project view as the src folder
This happens only after I click on Add Source root from IntelliJ, not by adding the alias from Deps toolwindow#2022-08-1110:56olttwa@cfleming all these changes disappear upon restart 😓#2022-08-1121:23cflemingOne thing I’ve just noticed, shouldn’t the key in the :perf alias be :extra-paths instead of :paths in Goose’s deps.edn?#2022-08-1207:00olttwa@cfleming modifying Clojure Deps tool window & s/:paths/:extra-paths/ fixed the issue. cc @U38004EG7
I had modified :perf alias in the past to see if :paths worked.
Thanks a lot :hugging_face:#2022-08-1108:20Ernesto GarciaHi all. Is there a way to see REPLs side by side, instead of overlapping tabs?
I would want to see Clojure and ClojureScript REPLs at the same time if possible.#2022-08-1109:10cflemingSo, there isn’t at the moment, but JetBrains have recently added the ability to do that in toolwindows and I’m planning to add it for REPLs. There are some open UX questions about how it should work. Currently, sending forms to the REPL send to the currently selected REPL, which is harder to determine if there are multiple REPLs visible at once.#2022-08-1109:11cflemingAnother option is to allow the user to open the REPL in a normal editor rather than a toolwindow, then you could just arrange them using the normal editor arrangement commands. It still has the same problem of identifying where to send forms etc.#2022-08-1110:02Ernesto GarciaYes, sending automatically to the proper REPL would further accelerate development. Sending based on to what module the file belongs could be a nice first guess. Doesn't work for multiple REPLs running from the same module of course. In that case, the last one might be a good guess. I'm not sure if many people use to have several REPLs for the same module.#2022-08-1121:24cflemingWell, having one for clj and another for cljs would be a common use case. When sending forms from clj or cljs the correct one could be chosen based on the file type, but cljc is trickier.#2022-08-1109:15souenzzoAny news on this ticket?
https://github.com/cursive-ide/cursive/issues/1918
There is some trick to run midje facts in cursive REPL?#2022-08-1109:16cflemingI’m very unlikely to support Midje. It has been effectively dead for ages and is a tangled mass of macros. Sorry 😞#2022-08-1217:40Joel@cfleming What is “Run ‘x-test’ in REPL” doing? I was curious if I could get a macro that evaluates to a deftest to be evaluated similarly.#2022-08-1221:35cflemingI think you can run Midje tests by just using deftest directly and having Midje assertions in the tests.#2022-08-1111:09roklenarcicAfter upgrading to JDK17 I get these errors after each expression in REPL:
Error updating class definitions:
Execution error (NullPointerException) at java.util.concurrent.ConcurrentHashMap/get (ConcurrentHashMap.java:936).
Cannot invoke "Object.hashCode()" because "key" is null
#2022-08-1111:18markaddlemanAre you using tools.namespace? I sometimes see this when reloading namespaces. I have never investigated but it seems to be some kind of race condition and the error has not impacted my development.#2022-08-1111:21roklenarcicI don’t get it when running JDK 8 or 14, but always when using 17, so that looks a bit less than a race condition then#2022-08-1203:53salamwe've been using Java 17 at work shortly after it was released and have never seen this error. is it possible for you to post the full stack trace?#2022-08-1409:57roklenarcicI cannot, because it doesn’t happen on the same thread#2022-08-1409:57roklenarcicif I say *e it just returns nil#2022-11-2216:45folconNot sure if this was ever solved, I've just started getting this error as well appearing...
Connecting to remote nREPL server...
Clojure 1.11.1
Error updating class definitions:
Execution error (NullPointerException) at java.util.concurrent.ConcurrentHashMap/get (ConcurrentHashMap.java:936).
Cannot invoke "Object.hashCode()" because "key" is null
*e
=> nil
Error updating class definitions:
Execution error (NullPointerException) at java.util.concurrent.ConcurrentHashMap/get (ConcurrentHashMap.java:936).
Cannot invoke "Object.hashCode()" because "key" is null
So this is connecting to a shadow-cljs nrepl running:
openjdk version "19.0.1" 2022-10-18
OpenJDK Runtime Environment Homebrew (build 19.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 19.0.1, mixed mode, sharing)
#2022-11-2219:21onetomI saw the error lately, but it happens very rarely#2022-11-2219:23onetomim on M1 macOS 13.0.1 (22A400) /nix/store/280df465g5isik8ljjnc8c31ncq2s4is-zulu17.34.19-ca-jdk-17.0.3/bin/java#2022-11-2220:13folconOk, good to know :)#2022-08-1111:09roklenarcicanyone else got these?#2022-11-2216:45folconNot sure if this was ever solved, I've just started getting this error as well appearing...
Connecting to remote nREPL server...
Clojure 1.11.1
Error updating class definitions:
Execution error (NullPointerException) at java.util.concurrent.ConcurrentHashMap/get (ConcurrentHashMap.java:936).
Cannot invoke "Object.hashCode()" because "key" is null
*e
=> nil
Error updating class definitions:
Execution error (NullPointerException) at java.util.concurrent.ConcurrentHashMap/get (ConcurrentHashMap.java:936).
Cannot invoke "Object.hashCode()" because "key" is null
So this is connecting to a shadow-cljs nrepl running:
openjdk version "19.0.1" 2022-10-18
OpenJDK Runtime Environment Homebrew (build 19.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 19.0.1, mixed mode, sharing)
#2022-08-1216:00João Galritohi.. I'm trying to help someone setup a leiningen project in cursive, but the "load file in REPL" option is grayed out, even when the repl is running#2022-08-1216:15imreis the file you’re trying to load on the classpath? is it under a source root?#2022-08-1216:15João Galritoit's in the source root#2022-08-1216:15João Galritosrc folder#2022-08-1216:16João Galritocreated by default when creating a lein project through IntelliJ#2022-08-1216:18João Galritohe was trying to run an existing project and it wasn't working, so we tried to create a new project from scratch and it still doesn't work#2022-08-1216:18João Galritoopening the same project on my computer works fine#2022-08-1216:44imreare yous running the same ide/cursive version?#2022-08-1313:17augustlmore intellij related than cursive itself, but maybe someone here knows: is there a way to customize intellij “emacs style”? Would be nice if I could have a config file that I could manage fully myself, that overrides defaults in IntelliJ. So far it’s mostly keybindings I want to manage this way. Anyone know if this is possible?#2022-08-1315:58jasonjcknif you get the intellij vim plug-in there’s a vimrc file that loads on startup, i can send you mine if you'd like #2022-08-1315:58augustlah, that’s an interesting way to do that 🙂 I’ll look into it#2022-08-1318:00Ivar RefsdalI have not tried this myself, but how about:
https://www.jetbrains.com/help/idea/sharing-your-ide-settings.html#settings-repository#2022-08-1318:01augustlI’ve tried that before actually, but it just ends up being an unmanagable repo of XML files you don’t manage yourself, and for some reason one of the few things it didn’t save was my key bindings. Maybe it’s improved though, this was a couple of years ago#2022-08-1318:16Ivar RefsdalHere ~/.config/JetBrains/<product><version>/linux.keymaps is rather readable XML with stuff such as:
<action id=":cursive.testing.actions/run-single-test">
<keyboard-shortcut first-keystroke="alt t" />
</action>
via
https://www.jetbrains.com/help/idea/configuring-keyboard-and-mouse-shortcuts.html#ecbc0a87#2022-08-1318:16augustlah, good point, I could just do it “by hand” and maybe some symlinks etc#2022-08-1318:17Ivar RefsdalYeah, I suppose so.#2022-08-1401:33cflemingI use the Settings Repository, it definitely syncs my keybindings.#2022-08-1318:49SchpaaI have no idea if this is a cursive issue, but IDEA is refusing to generate stubs, giving me a
Execution error (NoSuchMethodError) at com.google.javascript.jscomp.deps.ModuleLoader/createRootPaths (ModuleLoader.java:257).
'java.util.stream.Collector com.google.common.collect.ImmutableSortedSet.toImmutableSortedSet(java.util.Comparator)'
#2022-08-1504:14cflemingDoes this error appear in your logs? If so, could you send them to me, either via DM here or to <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection>?#2022-08-1318:50SchpaaI’ve been working in the same codebase for so long I dont know when this started to happen#2022-08-1718:50Colin P. HillI have a codebase with test assertions in a (= expected actual) convention, but Cursive assumes the opposite when you pull up the diff for a failed test. Is there any way to configure this?#2022-08-1817:06Jeffrey Bayit seems like cursive (sometimes) offers to add namespaces to the ns :require form, but not always. We have a theory that it is because it is doing a calculation and only adding it if it is not already required in the namespace's dependency chain, which satisfies the compiler. Is that the correct interpretation of what's happening? It is also considered bad style by basic linter options (`clj-kondo`) so if that is the correct interpretation it seems like it would be a good option to add in the namespaces section. If not - anyone have pointers as to what's going on?#2022-08-1907:31Otto NascarellaI wonder if Cursive will ever get support for Promises in Clojurescript… .then not being recognized as a symbol in 2022 feels wrong#2022-08-2201:27danielcomptonI got this error when trying to report crashes inside IntelliJ.
Build #IU-221.5787.30, built on June 1, 2022
Cursive: 1.12.4-2022.1#2022-08-2209:11imreI had that several times in the past year or so#2022-08-2215:45tengstrandI just got my new MacBook Pro with M1 chip. The problem is that I can't set up a clojure.deps (deps.edn) project. When I try to, I get an IDEA error + that I can't see the "Clojure Deps" tool bar on the right side.#2022-08-2215:45tengstrandThis is how the exception/error message looks like:
com.intellij.execution.ExecutionException: Cannot execute: Clojure command not configured
at cursive.deps.DepsProjectsManager$Companion.classpath(DepsSupport.kt:145)
at cursive.deps.DepsProjectsManager$Companion.resourceConfigFile(DepsSupport.kt:120)
at cursive.deps.DepsProjectsManager$Companion.configFiles(DepsSupport.kt:76)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:173)
at cursive.deps.DepsProjectDetails.doGetDetails(Project.kt:87)
at cursive.build.BuildSystemProjectDetails.getProjectDetails(BuildSystem.kt:45)
at cursive.build.BuildSystemProjectsManager.reimportAllProjects$lambda-3$lambda-2(BuildSystemManager.kt:149)
at cursive.build.BuildSystemUtil$runTask$1$1.run(BuildSystemUtil.kt:83)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:833)#2022-08-2215:50imreClojure command not configured#2022-08-2215:50imrehave you got it installed and set up in idea preferences?#2022-08-2215:50imreI’m on a m1 without problems#2022-08-2215:51tengstrandAhh, that’s probably the problem! Thanks!#2022-08-2215:51imre#2022-08-2215:52tengstrandYeah, now I remember, that’s in the “Install Cursive” instructions!#2022-08-2215:52imre👍:skin-tone-3:#2022-08-2216:03tengstrandYes, now everything works. Next time I will look closer to the error message! 🙂#2022-08-2300:09cflemingYeah, homebrew changes location on the M1 for some reason.#2022-08-2219:52Takis_#2022-08-2219:56Takis_i want to lein clean to delete the target before run, can i put somewhere this? or edit the project.clj to delete the target before new compile?#2022-08-2219:56Takis_i have some aot and doesnt work, unless i delete the target by hand#2022-08-2220:01Takis_i am asking how to delete the target before run, with intellidjea, if no other way i can run it as bash script#2022-08-2221:38Takis_for now i made it shell script and its fine, but i was wondering if i can do delete the target, while running it as clojure application with intellijdea#2022-08-2316:00Sam AdamsWhen I 'Run Test Under Caret in REPL', it seems that required namespaces which I've edited are automatically loaded; this can cause problems if the reloaded namespace contains protocol definitions. Is there a way to disable this automatic-reload behavior?#2022-08-2316:25imreperhaps this?#2022-08-2322:37Sam Adamsthere it is, thanks!#2022-08-2409:03mathias_dwHi, i saw the same question was asked a couple of times in the past, but no easy solution: is there a way to clear the repl search history? I have a few large blobs of data in there, and the search history has become unworkably slow. The repl search history is essential, so it’s rather important that it works smoothly…#2022-08-2412:43Rachel Westmacottone ugly workaround would be to turn the REPL history size down to 0, and then perhaps you can increase it again once it has forgotten what you did. (I haven't tested this!) downside is you'll lose the rest of the history.#2022-08-2413:19mathias_dwthanks, I’ll try that when it happens again. Half an hour ago the big blobs fell out of the history, so things work as normal again…#2022-08-2723:36cflemingI have a plan to do this, but I haven’t got around to it yet, sorry.#2022-08-2412:25Rachel WestmacottIs there a way to hook into the way specific types get printed at the REPL? It says it will pretty print in the settings, but if I modify the clojure.pprint/simple-dispatch multimethod it seems to ignore what I've done. (vs. eg. calling pprint manually which does pick up the change)#2022-08-2723:34cflemingThere isn’t at the moment, unfortunately. The way this works is that Cursive assumes that the form returned is (roughly) readable, then it will parse it using a similar mechanism to the one it uses for parsing normal code. That representation is then pretty-printed with fipp, and that process can’t be controlled at the moment. However, if you override printing on the server side to output a Clojure representation of e.g. a Java object, a record or something, then those customisations should work.#2022-08-2723:36cflemingIf that doesn’t mesh with what you’re trying to achieve, let me know and I’ll see if I can help work out a solution.#2022-08-2412:38Rachel WestmacottAlso while I love the 'Add forms sent from editor to REPL history' being disableable, it would be nice if when it was off there was some sort of feedback when you send a form to the REPL. I occasionally send some long-running things to the REPL and would aid user-confidence if there was some immediate feedback.#2022-08-2412:40Rachel WestmacottI really like not seeing the whole form printed in the output pane though, so I don't want that.#2022-08-2412:48markaddlemanWhat if the form sent to the REPL was folded up by default?#2022-08-2801:43cflemingThat sounds like it might be a good option. Note that that option also disables the forms being added to the history, not just them being printed in the output. I’m not sure what other sort of feedback might be appropriate, it seems like you’re looking maybe for some kind of spinner saying that something is being evaluated? That’s been suggested before.#2022-08-2518:56salami'm not sure if it's just happening for me but i noticed today that Navigate to Namespaces (Ctrl-Shift-O on macOS) shows duplicate entries for namespaces defined in CLJC files. this is not a deal breaker but a minor annoyance that causes confusion. is there a GitHub issue tracking this?#2022-08-2522:19cflemingI’m not sure, there are various issues tracking problems with CLJC. I’m going to have to re-work the whole CLJC bit at some point, it was a fairly horrible hack to begin with, and is really breaking at the seams now that ClojureDart, bb, and so on are also using it.#2022-08-2608:38reefersleepI’m on Cursive 1.12.5-eap1-2022.2. When I do Find Usage on a keyword like ::something/body, Cursive seems to look for :body in my code. It used to be able to find usages of the fully qualified keyword. Is something broken in my setup, or is this a regression in Cursive functionality? (I updated recently)#2022-08-2608:41reefersleepAh… My bad. We’re using some custom macro to do some trickery about the namespace part.#2022-08-2608:42reefersleepThe longer I work with code, the more I appreciate boring, predictable code. 🙂#2022-08-2608:43cflemingAmen!#2022-08-3018:47souenzzowrong highlight on schema after for+let+array destruct + map destruct#2022-08-3110:33souenzzoMinimal:
(for [m [{:a 1 :x 2}]
:let [x (:a m)]
{:keys [x]} [m]]
x)#2022-08-3110:34souenzzo#2022-08-3121:53cflemingGreat, thanks for the repro case!#2022-08-3114:13JAtkinsI just thought of this today - would it be possible for cursive to highlight all instances of a uuid literal in a file? Or, even better in the repl? I like being able to put my cursor on a keyword and see all usages, and for tests it'd be great to cross reference UUIDs without breaking out cmd-c cmd-f all the time#2022-08-3121:43cflemingThat’s actually a really nice idea. I can try to implement that, it might be tricky though since UUIDs are hard to identify - they’re basically just strings with hex chars in them.#2022-08-3121:43cflemingCould you file an issue for that and I’ll think about it?#2022-09-0519:36JAtkinsOops only saw this now#2022-09-0519:36JAtkinshttps://github.com/cursive-ide/cursive/issues/2727#2022-09-0609:33cflemingJust to be clear, your main use case is in the REPL output pane, right? So do you plan to jump to that and move around in the output to see the UUID matching?#2022-09-0611:03JAtkinsPrimarily - though it would also be nice in a clojure file. I used to, but do not now, write raw data in my tests. I now use generators and now have very few uuids in the actual code. #2022-09-0115:19Takis_hello, i am using [potemkin "0.4.5"] that allows us to import-vars and make a core.clj without the implementation of the functions in 1 file#2022-09-0115:20Takis_and it works fine when i require the core, i get autocomplete etc, but it doesn't work when the vars i try to import are defined in .cljc file, code works but no autocomplete#2022-09-0115:21Takis_at least when i test it, i had this problem, can i do something about it?#2022-09-0708:25wontheone1Hello I have a question,
While I can execute some code on REPL start from terminal, I don't know how to do that for Cursive REPL startup.#2022-09-0708:26wontheone1#2022-09-0708:27wontheone1I have put the same options in Parameters field but the REPL doesn't print 6 as I expected.
Can anybody help me with this?#2022-09-0715:45wontheone1Anyone please?#2022-09-0713:40helioscan you configure to put (or not put) a space in tagged elements?
i.e. Clojure CLI
$ clj
(random-uuid)
Clojure 1.11.1
user=> #uuid "46744ee8-a11c-4a4b-9e27-9e3dc4110702"
Cursive
(random-uuid)
=> #uuid"58a6af18-34d9-45eb-90f3-d6446d4016bf"
it leads to unnecessary whitespace changes#2022-09-0714:39seriogaIf you disable “Pretty print REPL return values” then whitespace will be OK.#2022-09-0714:43seriogaBut pprint itself is fine so the reason is not clear
(clojure.pprint/pprint (random-uuid))
#uuid "4130e408-256e-4ee3-b765-10de9a849e4b"
#2022-09-0721:57cflemingThis is because Cursive pretty-prints values on the client side. I’ll look at making those values match what Clojure does.#2022-09-0713:41Alex Miller (Clojure team)it's surprising to me that those are different. should be controlled by the print-method for UUID, which should be the same?#2022-09-0721:56cflemingCursive pretty-prints elements on the client side, which would cause this.#2022-09-0714:39seriogaIf you disable “Pretty print REPL return values” then whitespace will be OK.#2022-09-0714:43seriogaBut pprint itself is fine so the reason is not clear
(clojure.pprint/pprint (random-uuid))
#uuid "4130e408-256e-4ee3-b765-10de9a849e4b"
#2022-09-0716:44Jeffrey Bayit seems like cursive (sometimes) offers to add namespaces to the ns :require form, but not always. Does this only work for some reason if it detects an alias has been used in the project?#2022-09-0716:47imrehttps://clojurians.slack.com/archives/C0744GXCJ/p1615993736013900#2022-09-0716:48Jeffrey Bayum, yeah, i agree with that poster - i'd like for it to require it without a shorthand if the project doesn't have a shorthand (we don't use them) - is there an issue I can upvote or something?#2022-09-0716:56imrenot sure, there is an issues bookmark at the top of the channel, I would try searching there#2022-09-0717:05Jeffrey BayI couldn't find an existing issue, so I created a new one:
https://github.com/cursive-ide/cursive/issues/2728#2022-09-0808:58Vincent CantinHi, I updated Cursive to the latest version today and I get an error when trying to open a remote nREPL to a local Shadow-CLJS runtime:
Exception starting REPL: java.lang.IllegalStateException: Could not open new session; :clone response: Disconnected from remote server.
Do you have an idea where the problem comes from and how to work around it?#2022-09-0809:24cflemingI don’t, sorry. Perhaps try asking in #shadow-cljs, and if you don’t get anywhere there I’ll look at it tomorrow morning.#2022-09-0809:25Vincent CantinIt was working before I update intellij and cursive.#2022-09-0809:27cflemingDo you know which version you were on before?#2022-09-0809:27cflemingThis is connecting to the Shadow Clojure REPL, right? Not the CLJS one?#2022-09-0809:27Vincent CantinYes, the Clojure one#2022-09-0809:28cflemingOk, I’ll try this with a Shadow project tomorrow. Is your project public?#2022-09-0809:29Vincent CantinI don't know which version exactly, but I know that it was the latest intellij and cursive version I was able to use with my license expired on March 23th. I renewed the license this morning.#2022-09-0809:29Vincent CantinThe project is not public.#2022-09-0809:30cflemingOk, I’ll try with some shadow projects I have lying around.#2022-09-0809:32Vincent CantinI just found that it works if I connect by setting the host + port#2022-09-0809:34Vincent CantinIt also works when I set the port file to .shadow-cljs/nrepl.port manually#2022-09-0809:35Vincent CantinIt doesn't work when I choose the "Use standard port file"#2022-09-0817:04thhelleryou probably have another port file lingering around with a dead port?#2022-09-0903:57Vincent CantinI didn't find such file. When shadow-cljs (2.19.5) is not running and I try to connect a repl from the IDE using "Use standard port file", I get a different error from the IDE in a notification bubble saying "Cannot find port from port file". So I guess it is not a problem with a lingering port file.
for info, when shadow-cljs is running:
$ ls .shadow-cljs
babel-worker cli-repl.port jar-manifest server.pid socket-repl.port
builds http.port nrepl.port server.token
#2022-09-1220:28Dustin GetzI also have this – i updated Cursive first, and then a couple days later upgraded CLJS and Shadow to
org.clojure/clojurescript {:mvn/version "1.11.60"}
thheller/shadow-cljs {:mvn/version "2.20.1"}
at which point i believe i got the error. Found this thread by global search, I did not suspect Cursive. Sitting down now to try to triangulate#2022-09-1220:44Dustin GetzOk, on Cursive 1.12.5-eap1-2022.1, Cursive Clojure Local REPL, nREPL, Run With Deps, on startp a .nrepl-port is produced in project root.
Starting nREPL server...
WARNING: compile already refers to: #'clojure.core/compile in namespace: user, being replaced by: #'user/compile
Connecting to local nREPL server...
Clojure 1.11.1
nREPL server started on port 56232 on host localhost -
Immediately - now Cursive Remote REPL, nrepl, use port from REPL file in project ..., use standard port file:
Connecting to remote nREPL server...
Clojure 1.11.1
Close remote REPL
Now when I run
(def shadow-start! (delay @(requiring-resolve 'shadow.cljs.devtools.server/start!)))
(@shadow-start!)
output is now:
Starting nREPL server...
WARNING: compile already refers to: #'clojure.core/compile in namespace: user, being replaced by: #'user/compile
Connecting to local nREPL server...
Clojure 1.11.1
nREPL server started on port 56232 on host localhost -
(@shadow-start!)
shadow-cljs - server version: 2.20.1 running at
shadow-cljs - nREPL server started on port 9001
=> :shadow.cljs.devtools.server/started
additionally, a second .nrepl-port file is produced shadow-cljs/.nrepl-port
Cursive Remote REPL, autodetect port:
Connecting to remote nREPL server...
Exception starting REPL: java.lang.IllegalStateException: Could not open new session; :clone response: Disconnected from remote server.
#2022-09-1220:45Dustin GetzClojure and Shadow version doesn't impact this, I can repro these steps with the following two configurations:
org.clojure/clojurescript {:mvn/version "1.11.60" #_"1.11.4"}
thheller/shadow-cljs {:mvn/version "2.20.1" #_"2.18.0"}
#2022-09-1220:46Dustin GetzExplicitly setting the CLJS nrepl port to shadow-cljs/.nrepl-port obviously fixes the error#2022-09-1220:46Dustin GetzDid the autodetect rules change or did the generation of the file change in either Cursive or Shadow recently? Not sure why this is suddenly happening or where the bug is or if there even is a bug#2022-09-1221:00cflemingThanks for the repro information, I’ll try to repro that today. I don’t think the autodetect rules have changed recently. Thomas might know if shadow’s generation of port files has changed, although it seems like maybe a change to nREPL is generating the .nrepl-port rather than Shadow doing it.#2022-09-1221:01thhelleryeah, shadow-cljs parts haven't changed in forever#2022-09-1221:01thhellerhowever I upgraded to nrepl 1.0 and didn't check what it is doing in those regards#2022-09-1221:01Dustin Getzwhen#2022-09-1221:01thhellermaybe it just always creates this file?#2022-09-1221:01cflemingOk, I’ll try to repro that and see if I can figure out what’s going on.#2022-09-1221:02thheller2.20.0 was the upgrade to nrepl 1.0#2022-09-1221:02Dustin GetzOk I will check again now, maybe I didn't cleanly test when i reverted back to 2.18.0#2022-09-1221:03cflemingJust to be clear, it looks like you’re starting the Shadow REPL using a Cursive nREPL config rather than on the command line, correct?#2022-09-1221:04Dustin GetzUm i am calling shadow.cljs.devtools.server/start! from cursive Local repl to start shadow's nrepl#2022-09-1221:04Dustin Getzthis results in two running nrepl services, one from the Cursive local repl and one from Shadow – which I did not realize I was doing until today#2022-09-1221:05Dustin Getz#2022-09-1221:06cflemingSo in that case, I’d expect to see what you’re seeing in terms of port files. Starting the nREPL server via the Cursive nREPL config will create .nrepl-port, and Shadow’s nREPL will create .shadow-cljs/.nrepl-port. However I don’t think any of that has changed in a long time, and it shouldn’t cause an error obviously.#2022-09-1221:07cflemingHowever my impression is that Vincent wasn’t doing that, since he said he didn’t find an .nrepl-port file.#2022-09-1221:09Dustin GetzCarefully testing with shadow-cljs "2.18.0" (rm -rf .shadow-cljs && rm .nrepl-port) and I still repro - i can see the Cursive Local REPL create .nrepl-port within a few seconds of startup#2022-09-1221:09Dustin Getzi dont think a shadow 2.20 change is in play#2022-09-1221:11cflemingOk, thanks.#2022-09-1406:06AronI have this error too, but in my case neither of the options result in a running repl
I suspect it's because I want to connect to a shadow repl inside wsl2 from windows#2022-09-1514:38Aronmoved from wsl2 to just using git bash and I am here https://gist.github.com/ashnur/9264574919de333e463e591a9fcba008
Not even sure where to look after this. Will have to try with a different editor.#2022-09-2614:48Dustin GetzCursive 1.12.5-eap1 - 2022-08-03
Add ability for socket REPL to pick up the port from a file #2695#2022-09-2616:10Aronhttps://imgur.com/N7sKjS8#2022-09-0814:59octahedrionI don't know if this is Cursive thing or an IntelliJ thing but is there a way to make project structure > modules default to excluded for all subfolders ? I'm pretty sure IntelliJ eagerly indexes everything not exluded in there, including folders like .cpcache, .git, .circleci etc#2022-09-0815:15Jordan Robinsonthis may or may not help, but I've found if you open the .gitignore in intellij in recent versions it will ask you if you want to add everything there into excluded folders#2022-09-0815:16Jordan Robinsonthough I can't say I've seen intellij indexing the .git folder myself#2022-09-0819:58salamthis may help: https://www.jetbrains.com/help/idea/creating-and-registering-file-types.html#ignore-files-folders#2022-09-0908:14octahedrionthanks but that tells IntelliJ to totally ignore those files/folders, i.e. they won't even appear in the project view, whereas I still want to see some such folders in the project view, but I want them excluded from indexing#2022-09-1308:14polymerisHello! I am running into an issue where IntelliJ, under some circumstances, leaks memory. I am not sure what the root cause is, but I’d like to try updating Lein.
Cursive’s Leiningen settings dialog doesn’t show versions above 2.9.3, even though I have 2.9.10 installed. The Cursive version is 1.12.4.#2022-10-1008:23polymeris@U0567Q30W could the list of supported lein versions be expanded in the next release? I tried the EAP and it’s still the same#2022-10-1008:58cflemingYes, sorry, I’ll make sure that gets done for the next release.#2022-10-1008:58polymerisThank you! :D#2022-09-1413:36danmHow do I tell Cursive that I want to start a REPL within the context of a specific alias? Like, the equivalent within a run configuration of clj -A:dev? Setting -A:dev under 'Parameters' gives:
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-A:dev (No such file or directory)
and then the REPL exits#2022-09-1413:45danmAah, I just had to tell it to use Run with Deps instead of Run with IntelliJ project classpath#2022-09-1413:54imreI use the latter and tick the aliases I want in the deps tool window#2022-09-1413:54imrefollowed by Refresh Clojure Deps Projects#2022-09-1414:59danmI've got a deps.edn with an alias specified as:
:cider {:main-opts ["-e" "(require (quote griffin.user))" "-m" "nrepl.cmdline" "--middleware" ["cider.nrepl/cider-middleware"]]}
When I launch the REPL in a terminal via clj -M:cider it works fine. When I try and use IntelliJ run configurations to launch an nREPL run with deps and include cider as an alias, it bombs out with
nREPL middleware: --interactive has no namespace
Does anyone have any pointers as to where I even begin to debug that? o.0#2022-09-1415:01imreWhy do you need that alias?#2022-09-1415:05danmTechnically I only need the ["-e" "(require (quote griffin.user))"] bit of it, which I can put in another alias just fine. This is just curiosity. The :cider alias is for our team mates who are using Emacs (or Vim with the right plugins), but I thought all Cursive was doing was launching the REPL in the background with clj and connecting to it from an nREPL client, so I don't get why that alias would work on the CLI but not through a run config.
It's just a bit of a faff to say "Emacs users need alias X, IntelliJ users need alias Y"#2022-09-1415:05danmI Googled the error I got back, and got 0 results#2022-09-1415:06danmI was at least expecting to see where it was generated on GitHub or similar...#2022-09-1415:08imreyeah you certainly don't need cider for cursive#2022-09-1415:08imreand I don't think ["-e" "(require (quote griffin.user))"] works in Cursive#2022-09-1415:08danmOh that does, definitely#2022-09-1415:08imreoh does it?#2022-09-1415:08imrethat's new 🙂#2022-09-1415:09imreat least to me#2022-09-1415:09imrenice#2022-09-1415:09danmI do recall at one point trying to set up the cider middleware, but I forget why I wanted it now. There was one specific feature it offered that I thought was handy and it'd be good to try and get in the Cursive REPL#2022-09-1415:09danmCan't have been that important if I forgot what it was 😉#2022-09-1415:10imreI'd use 2 aliases and emacs people could use -M:startupcommand:cider and cursive just startupcommand#2022-09-1423:47Cora (she/her)is there a way to show the file extension when searching for a file by filename in the project files panel?#2022-09-1612:34eskosWhich search are you referring to specifically? IDEA has a bazillion ways to slice the search ham 🙂#2022-09-1613:00Cora (she/her)cmd+shift+o#2022-09-1613:01kwladykaI see extensions, can you upload a screenshoot what is missing for you?#2022-09-1613:04Cora (she/her)where do you see the .clj file extension in that screenshot?#2022-09-1613:05kwladykaoh you are right… lol. sorry#2022-09-1613:06kwladykaI think I used to look on icons#2022-09-1613:06Cora (she/her)haha I was genuinely confused#2022-09-1613:06Cora (she/her)that's what i've had to do, too, but I really don't like it#2022-09-1613:07kwladykaI can’t help. I have never tried to find a solution for this.#2022-09-1613:09Cora (she/her)thanks for checking, though!#2022-09-1613:55eskosI was slightly confused for a moment - I’ve rebound my cmd+shift+o to be actually the Namespaces search instead of Files. Namespaces shows file types in ambigous cases.#2022-09-1613:57eskosThe correct action to bind is in Settings > Keymap / Plugins > Cursive > Namespace... (and possibly also Main Menu > Navigate > Namespace...)#2022-09-1614:03eskosJust to prove a point, I did this rebinding change some time ago when I was working on a project which had a certain preference to naming things and realized that the cmd+shift+o wasn’t doing the thing I assumed it should… 😅#2022-09-1614:05Cora (she/her)I don't only search for clojure files though?#2022-09-1614:09eskosThen the double-shift/“all” search would be more appropriate imo. It shows paths.#2022-09-1423:48Cora (she/her)probably not a cursive question#2022-09-1423:50Cora (she/her)I just have a hard time believing people don't need to see this#2022-09-1612:58kwladykahey, any chance to make Cursive auto code complete for https://github.com/clj-python/libpython-clj ? Should I make an official issue for this one?#2022-09-1623:18cflemingUm, sure, an issue would be good. I don’t know anything about it, but it looks like it might be tricky to support that one.#2022-09-1707:29kwladykahttps://github.com/cursive-ide/cursive/issues/2731#2022-09-1709:12cflemingYep, I saw that later, thanks!#2022-09-1700:20genekim@borkdude Well, wow. I was so inspired by the “binaural beats” project, that uses scittle to enable using ClojureScript in <script> tags, that I’m attempting to modify a Chrome Extension that scrapes my order information from a https://amazon.com, which was written in JavaScript. (By someone on Upwork, who has since disappeared!)
https://clojurians.slack.com/archives/C8NUSGWG6/p1663273758784879?thread_ts=1663232347.793979&cid=C8NUSGWG6
I’ll have some proposed doc changes, or at least a writeup of my experiences trying tog et a simple “hello, world” app running.
But I’m having a strange problem connecting to the browser nREPL, which is preventing big leaps in progress. Here’s what I’m seeing in my REPL session inside of Cursive.
1. Anyone have any ideas how I can make these REPL errors go away? I used used Cursive “create remote REPL session”, port 1339. It executes the forms, but I always get these errors.
2. less big of a deal: “Executing this form” inside of a comment always sends the entire comment form to the REPL session, instead of just the one form.
Thank you all — I am really quite excited by the idea of writing these 10-50 line programs inside of html files!
(.-innerHTML q)
=> "Read <a href=\"index.html\">the main page</a> for more details."
Error updating completions:
"#error {:message \"Could not resolve symbol: cursive.repl.runtime/completions\", :data {:type :sci/error, :line 1, :column 1, :message \"Could not resolve symbol: cursive.repl.runtime/completions\", :sci.impl/callstack #object[cljs.core.Volatile {:val ({:line 1, :column 1, :ns #object[Ao bookmarklet], :file nil})}], :file nil, :phase \"analysis\"}, :cause #error {:message \"Could not resolve symbol: cursive.repl.runtime/completions\", :data {:type :sci/error, :line nil, :column nil, :file nil, :phase \"analysis\"}}}"Error updating completions:
"#error {:message \"Could not resolve symbol: cursive.repl.runtime/completions\", :data {:type :sci/error, :line 1, :column 1, :message \"Could not resolve symbol: cursive.repl.runtime/completions\", :sci.impl/callstack #object[cljs.core.Volatile {:val ({:line 1, :column 1, :ns #object[Ao bookmarklet], :file nil})}], :file nil, :phase \"analysis\"}, :cause #error {:message \"Could not resolve symbol: cursive.repl.runtime/completions\", :data {:type :sci/error, :line nil, :column nil, :file nil, :phase \"analysis\"}}}"#2022-09-1700:22genekimJust in case it’s helpful, here’s a screenshot of REPL settings.#2022-09-1700:24genekim…and here’s what shows up in babashka serving up the REPL session:
:msg "{:err \"\\\"#error {:message \\\\\\\"Could not resolve symbol: cursive.repl.runtime/completions\\\\\\\", :data {:type :sci/error, :line 1, :column 1, :message \\\\\\\"Could not resolve symbol: cursive.repl.runtime/completions\\\\\\\", :sci.impl/callstack #object[cljs.core.Volatile {:val ({:line 1, :column 1, :ns #object[Ao bookmarklet], :file nil})}], :file nil, :phase \\\\\\\"analysis\\\\\\\"}, :cause #error {:message \\\\\\\"Could not resolve symbol: cursive.repl.runtime/completions\\\\\\\", :data {:type :sci/error, :line nil, :column nil, :file nil, :phase \\\\\\\"analysis\\\\\\\"}}}\\\"\", :id \"a4c7a151-0844-4908-87f0-14d9b1a5996e\", :session \"d130a53e-3b69-48fa-8e09-23ab6295b104\", :ns \"bookmarklet\"}"
:msg "{:ex \"\\\"#error {:message \\\\\\\"Could not resolve symbol: cursive.repl.runtime/completions\\\\\\\", :data {:type :sci/error, :line 1, :column 1, :message \\\\\\\"Could not resolve symbol: cursive.repl.runtime/completions\\\\\\\", :sci.impl/callstack #object[cljs.core.Volatile {:val ({:line 1, :column 1, :ns #object[Ao bookmarklet], :file nil})}], :file nil, :phase \\\\\\\"analysis\\\\\\\"}, :cause #error {:message \\\\\\\"Could not resolve symbol: cursive.repl.runtime/completions\\\\\\\", :data {:type :sci/error, :line nil, :column nil, :file nil, :phase \\\\\\\"analysis\\\\\\\"}}}\\\"\", :status [\"error\" \"done\"], :id \"a4c7a151-0844-4908-87f0-14d9b1a5996e\", :session \"d130a53e-3b69-48fa-8e09-23ab6295b104\", :ns \"bookmarklet\"}"#2022-09-1700:42cflemingSo I think this is a problem in Cursive which was discussed recently (messy on Twitter): https://twitter.com/jackrusher/status/1525092640286560258#2022-09-1700:43cflemingIn particular: https://twitter.com/CursiveIDE/status/1525249387487961088#2022-09-1700:44cflemingAnd here: https://github.com/nrepl/nrepl/discussions/273#2022-09-1700:45genekimHa! Thank you, @U0567Q30W — I saw that on Twitter, and filed that away as, “sounds academically interesting, but I doubt it will ever affect me.”
😆#2022-09-1700:45cflemingHaha!#2022-09-1700:45cflemingSadly, famous last words.#2022-09-1700:46cflemingI’ll try to get the generic completion into the next EAP build.#2022-09-1700:48genekimSeriously, I’m reading the discussion with avid interest, but also telling myself, this is like reading the standards for floating point numbers.
(ala, super important to make the world work, but in the domains of control vs. influence vs. concern, this is definitely under “concern,” like the weather.
I am in awe of the people on the thread who are actually in control of this stuff!#2022-09-1700:49genekimThanks so much for explaining this, @U0567Q30W — eager to see what y’all come up with!#2022-09-1700:50cflemingThe TL;DR is that Cursive tries to sniff the REPL server type, and falls back to assuming JVM Clojure if it can’t work it out. It should really fall back to something more generic than that, which nREPL supports but Cursive doesn’t take advantage of.#2022-09-1700:50genekimJust curious: what causes the second issue, of “send current form to REPL” to send not one form, but the entire comment form?#2022-09-1700:54genekimPS: Holy cow. “(nREPL, socket REPL, direct IDE eval, debug REPL etc)“. 😆
My apologies if laughing isn’t quite appropriate, but yow, this stuff is complicated!#2022-09-1701:06cflemingYeah, it really is, and CLJS adds an entire new dimension to the matrix (browser, node, things like scittle and nbb)#2022-09-1701:06cflemingThe comment form thing is interesting. Is this in a CLJS file?#2022-09-1701:08cflemingOne workaround is to select the form you want to send, send to REPL will always use the selected form if any before deciding which to send if nothing is selected.#2022-09-1701:09cflemingIt’s a bit crap, obviously, it would be better to figure out why your comments aren’t working.#2022-09-1701:09genekimYes — CLJS to bb, as per here:
https://github.com/babashka/scittle/tree/main/doc/nrepl
at first I didn’t think anything was getting evaluated, but I noticed it was sending entirety of (comment … ) form.#2022-09-1701:09cflemingIn your source file, is comment being resolved properly? i.e. it’s not highlighted, and you can get doc and so forth from it?#2022-09-1701:09genekimNo worries for now — I’ll send you a movie of this happening, with more of the context. May not be for a week or two.
Hardly urgent. Thanks as always!#2022-09-1701:12genekimOh! That’s interesting! You’re right — nothing was highlighted correctly. Like defn everything not being highlighted.
Cursive didn’t show the “add source root?” message, either.
I’ll show you in the movie the repo, deps.edn file, bb.edn file. and all the strangeness. I’m sure the details will illuminate, versus my vague descriptions!#2022-09-1701:12cflemingOk, thanks! Or just a repro repo on github would be good, then I can check it out and try it myself.#2022-09-1701:13cflemingNot sure if that’s more or less work than the movie…#2022-09-1701:13genekimRoger! Have a wonderful weekend!#2022-09-1701:13cflemingThanks, you too!#2022-09-1711:25roklenarcicWhen using :as-alias in cljs files, the require with as-alias for non-existing namespace will cause all requires above it to appear invalid:#2022-09-1711:25roklenarcicsame thing in clj file:#2022-09-1711:26roklenarcic#2022-09-1721:19cflemingI’ll check that, thanks.#2022-09-1917:03kanweiHey! has there been any progress with cljfmt support? We have team members using a mix of Cursive and CIDER#2022-09-1920:54cflemingThere hasn’t, but if you can show me cases which are causing you problems, I can try to help configure Cursive to match whatever your team needs.#2022-09-1921:55hadilsHi! Thank you for this excellent product! I am wondering if Cursive works with modules. I have recently refactored my deps.edn project into a monorepo consisting of several modules. I have noticed two things: the heap is getting exhausted (at 10GB) and stub generation seems to be failing.#2022-09-1923:03cflemingYes, it should do, I use multi-module projects all the time. Do you get an error with the stub generation? Also, do you have a memory report from when it runs out of memory?#2022-09-1923:04hadilsI got a notification for the stub generation. Is there a log file that I should read/post?#2022-09-1923:05cflemingYep, Help | Show log in Finder/Explorer. You can either post it here or email it to <mailto:/cdn-cgi/l/email-protection|/cdn-cgi/l/email-protection> if it contains sensitive info.#2022-09-1923:06hadilsThank you Colin. I appreciate your excellent work!#2022-09-1923:06cflemingThanks for the kind words!#2022-09-2021:35Cora (she/her)it would be so nice if cursive had protection from more protection from deletes causing unbalanced parens#2022-09-2021:37R.A. PorterAre you using paredit or parinfer? I've found that, as long as the file is formatted correctly, parinfer is slightly better about maintaining balance.#2022-09-2021:37Cora (she/her)paredit, but I'm using built-in facilities for deleting a line, and the vim plugin's line deletion#2022-09-2022:06cflemingJust so I’m clear, you mean that e.g. if a line is deleted, that the parens are rebalanced?#2022-09-2022:08Cora (she/her)any full forms (including opening and closing) on that line are deleted, any parameters within a form are deleted, any closing parens/curlies/brackets are moved up to the end of the previous line#2022-09-2022:08Cora (she/her)evil-cleverparens and lispy handle this in the emacs world#2022-09-2022:09cflemingWhat you’re describing is basically what parinfer does. It works on general edits to the document, and tries to always fix up the parens correctly. It’s not perfect, but it’s pretty close these days.#2022-09-2022:09Cora (she/her)doesn't that require specific indentation?#2022-09-2022:10Cora (she/her)whatever I use has to be workable by an entire team with lots of different editors#2022-09-2022:10cflemingIt requires the indentation to be within various (sane, imo) parameters, yes. However, Cursive won’t automatically reformat files which don’t conform, it will just mark where the problems are and turn parinfer off for that file until they’re fixed.#2022-09-2022:11cflemingI have plans to make parinfer more local, i.e. only operate at the level of a top-level form, but that’s just a pipe dream at the moment.#2022-09-2022:12Cora (she/her)I don't think this is an option for my team 😞#2022-09-2022:13cflemingUnfortunately there’s not much middle ground here. IntelliJ has hundreds and hundreds of editing actions, and I can’t modify all of them to fix up parens.#2022-09-2022:13R.A. PorterI've tended to run cljfmt prior to commit to ensure compatibility, but that only works if everyone else is also good with cljfmt's choices.#2022-09-2022:13Cora (she/her)one of my coworkers pointed out the same issue with "I love Cursive except" and I tried to find a solution to no avail#2022-09-2022:14Cora (she/her)deleting whole lines is the main use case for me and the two people I've spoken to about this feature.#2022-09-2022:14Cora (she/her)I suppose I'd need to make my own intellij extension to work around this#2022-09-2022:15Cora (she/her)thanks for chiming in @U0567Q30W!#2022-09-2022:15cflemingProbably, yes. But I bet you’d quickly find a lot of other cases you’d like to work too.#2022-09-2022:15Cora (she/her)and thanks for the input @U01GXCWSRMW#2022-09-2022:15Cora (she/her)hmmm maybe#2022-09-2022:15cflemingDo evil-cleverparens and lispy work generally for any emacs action, or do they just monkey-patch certain common actions?#2022-09-2022:16cflemingOr do they require the user to use their own variants?#2022-09-2022:17Cora (she/her)evil-cleverparens (the one I use) uses their own function as the key binding in place of the default#2022-09-2022:17Cora (she/her)so if I checkout what is bound to dd (delete line, in vim) it has evil-cp-delete (evil-cleverparens functions start with evil-cp )#2022-09-2022:18cflemingOk, so it only works for certain actions. That’s really hard to do in IntelliJ land, because the actions work together in various ways, and are surprisingly complicated due to things like code folding and language injection.#2022-09-2022:18Cora (she/her)I need to run, headed out to dinner with my family. I'm happy to discuss it more later!#2022-09-2022:18cflemingNo worries.#2022-09-2022:19Cora (she/her)ahhh yeah I can see it getting real complicated. this is probably why there are a million bridge extensions between different extensions in emacs-land. like if cursive had something equivalent it would be a vim-cursive extension that makes them play well together#2022-09-2022:20cflemingYeah, I don’t know how extensible IdeaVim is, I don’t use it myself.#2022-09-2022:35Cora (she/her)that seems like a good place to start#2022-09-2100:43Cora (she/her)http://monosnap.sutton.me/20220920194258-hvc4j-cursive-action-list.png#2022-09-2100:44Cora (she/her)so with ideavim I can execute those options (and more) from key combinations and I think even from functions. I imagine I can hack together something that would be similar to what I want#2022-09-2101:33Cora (she/her)I wonder how backspace keeps parens balanced. because deleting a line is really just jumping to the end of the line and deleting using backspace until it jumps you to the next line#2022-09-2101:36Cora (she/her)because deleting a line using it could just be programatically hopping to the end of the line and backspaceing until the whole line is gone. balance maintained#2022-09-2103:50cflemingYep that would work. I’d have to check the code for the details, but IIRC backspace just jumps over closers, and for openers if they immediately precede the corresponding closer then both are deleted. A more efficient method would be to count the openers and closers on a line (maintaining a stack to check matching) and then depending on whether the final count is positive or negative you stack some closers at the end of the previous line or some openers at the start of the following line.#2022-09-2103:51cflemingBut there are lots of edge cases too - what to do if they’re unbalanced, you might be inside a long string, or you might have a string ending at the beginning of the line, or starting at the end of the line. If you insert openers at the start of the following line then do you indent the affected forms? etc etc#2022-09-2103:52cflemingAnd before you know it you have an ad hoc, informally-specified, bug-ridden, slow implementation of half of parinfer 🙂#2022-09-2103:53cfleming(per Greenspun: https://en.wikipedia.org/wiki/Greenspun%27s_tenth_rule)#2022-09-2104:05Cora (she/her)sure but this is more like a 95/5 where just exploiting backspace would work for the vast majority of cases. I likely can't have perfection without a massive amount of work and so I'll take what I can get#2022-09-2104:12cflemingThat’s fair enough, for sure.#2022-09-2116:32genekimA public service announcement, on the value of (sometimes? always?) using REPLs with classpath set with deps.edn, instead of IntelliJ project classpath. I spent hours while trying to get the Google Secret Manager library working, thinking I was struggling with conflicting google library dependencies, which I’ve heard people complain about.
I must have made 20+ changes to dependencies, to no avail.
Inspired (and desperate for answers) by the 2019 message, I tried running it in a clj repl session, and to my utter shock, it worked.
(So, I guess it was indeed a conflicting google library dependency, but nothing to do with deps.edn ! 😂
https://clojurians.slack.com/archives/C02BJCKN0R4/p1663777642867749#2022-09-2116:42imrehave you figured out how the rogue dep got onto the IJ classpath?#2022-09-2116:44genekimAlas, no — I was just happy to get it working. I barely know what a classpath is. 🙂
I was thinking it may have been clojurescript and the google-closure-compiler, but ruled that out. Maybe?
I may revisit it tonight — will keep you posted, as I suspect it’s worth understanding more fully.#2022-09-2116:47imreWhen you start up a cursive nrepl (if it's nrepl you're talking about), the second line in it, (the one that starts with something like /Users/myuser/... is clickable and contains the classpath#2022-09-2116:49imreat least for me, this could depend on your OS, how you have java installed etc#2022-09-2116:34caleb.macdonaldblackAnyway to disable ~tag literals for maps with keywords~ namespace map syntax?
Instead of this:
{:foo/bar 1
:foo/bar2 2}
=> #:foo{:bar 1, :bar2 2}
I could get this:
=> {:foo/bar 1, :foo/bar2 2}
Also no commas would be nice too#2022-09-2116:42caleb.macdonaldblackIt’s a clojure setting
(set! *print-namespace-maps* false)
#2022-09-2116:45Alex Miller (Clojure team)Just for reference, this is “namespace map syntax” and not tagged literals (although they look similar at a glance)#2022-09-2117:31caleb.macdonaldblackAh no worries. Thanks for the correction.
It’s clear to me now they’re completely different.
> Tagged literals are Clojure’s implementation of edn tagged elements.#2022-09-2118:21dpsuttonthe commas come from the printer (they aren’t a part of the datastructure of coure). I haven’t seen any pretty printers that omit them. I think they are pretty hard coded in there. I have often wanted to get rid of them#2022-09-2120:12NoahTheDukezprint can exclude them, but that's a much more opinionated and complicated tool#2022-09-2119:09Dustin GetzThe new auto-require on typing of recognized namespace is excellent, I just noticed it#2022-09-2306:30cflemingWhich one do you mean? I don’t think anything new has been added there in a while.#2022-09-2216:56onetomhas anyone know how to use the built-in IntelliJ Profiler with Cursive?
I'm getting a Deferred configurations cannot be run with standard runners error, when I try to start my local clojure repl with the Profile with 'IntelliJ Profiler' run config action.
I've documented the issue here:
https://github.com/cursive-ide/cursive/issues/2514#issuecomment-1255297521#2022-09-2306:25cflemingThanks, I’ll take a look at this and see if I can figure out what’s going on.#2022-09-2312:38onetomit worth a quick look, but i think it was pretty painless to setup https://github.com/clojure-goes-fast/clj-async-profiler instead (as i mentioned in my follow-up comment), so if u can just mention that in https://cursive-ide.com/userguide/ that should be a sufficient solution.#2022-09-2313:08onetommaybe link this intellij page from the cursive docs:
https://lp.jetbrains.com/intellij-idea-profiler/
and mention, that while this is a fancy and tight integration of async-profiler with intellij, cursive unfortunately does not support it (and maybe mention that known Deferred configurations ... error), but the clj-async-profiler is a great alternative in the meantime and it's still reasonable comfortable to use.#2022-09-2313:08onetomat least that's what i would love to read in your users guide to make me a happy customer 🙂#2022-09-2405:49cflemingI guess even better would be that it just work with IntelliJ 🙂#2022-09-2416:28Jeff EvansIs anyone having issues getting the assertion failure diff to render properly in the IDE? I double checked that I am current on license/IDE/plugin version, and still, hovering over the squiggly lines doesn’t show the actual diff between expected and actual. It only shows “Assertion failed. <test context name”. Also, clicking on the warning icon in the left line number bar tries to set a breakpoint, instead of popping up the diff view. Both of these behaviors used to work fine, so I’m wondering what changed? Maybe something I need to update on my end?
Edit: figured out what was going on. The actual value was (quite unexpectedly) nil instead of some map. In this case, the little “Show difference” option is not even available on hover over. Might be a nice enhancement for it to still allow the “Show difference” option, and show the full expected map on the left, with simply nil on the right?#2022-09-2417:02Ivar RefsdalI've seen more people been confused by this as well..#2022-09-2504:01cflemingCould you file an issue for that so it doesn’t get lost? That definitely sounds like something that needs fixing.#2022-09-2820:33Jeff EvansWell, truth be told, I’m unable to repro the problem in a standalone, dead simple test case I tried, so I’m wondering what might be causing it for my complicated project :thinking_face:
Cursive is doing the right thing for both of these:
(deftest sample-test
(is (= nil {:a 1})))
(deftest sample-test
(is (= {:b 1} {:a 1})))#2022-09-2523:39cfleminghttps://twitter.com/CursiveIDE/status/1574181375556481024#2022-09-2604:58onetomi tried the New UI temporarily in the latest IntelliJ EAP, but it has affected the look and feel of the IntelliJ Release installation, so I have to use the EAP version. Thanks to this quick Cursive release, I can continue coding!#2022-09-2605:04onetomok, nvm, i did 1 more restart of the release version and the UI looks like the old one, correctly now.#2022-09-2605:00onetomBTW, I had a quick look at Analyze Plugin Startup Performance and Cursive takes the most time to initialize:
❯ pbpaste|awk '{cnt=$NF; $NF=""; print cnt, $0}'
1896 Cursive
1710 Grazie
677 Database Tools and SQL
447 JavaScript and TypeScript
...
I'm wondering, if there would be any low-hanging fruits, which could lower this initialization time.
Have you looked into this @cfleming yet?#2022-09-2605:01onetomHere is a full list of my plugin startup times:
❯ pbpaste|awk '{cnt=$NF; $NF=""; print cnt, $0}'
1896 Cursive
1710 Grazie
677 Database Tools and SQL
447 JavaScript and TypeScript
238 Shared Indexes
159 GitHub
152 Configuration Script
146 Git
41 FTP/SFTP/WebDAV Connectivity
36 Maven
34 IDE Settings Sync
25 HTTP Client
24 Gradle
22 Machine Learning Code Completion
19 Vue.js
19 CSS
16 Shared Project Indexes
13 SSH Remote Run
11 YAML
10 Diagrams
9 EditorConfig
9 Node.js
8 Properties
8 JavaScript Debugger
7 WebP Support
7 Markdown
5 Webpack
4 Shell Script
3 Node.js Remote Interpreter
3 JUnit
3 Completion Stats Collector
3 Nyan Progress Bar
2 Package Search
2 Project Wide Analysis
1 HTML Tools
1 Images
1 Karma
1 Settings Sync
1 Java Bytecode Decompiler
1 Prettier
1 Live Edit
1 Polymer & Web Components
1 Terminal
0 Machine Learning in Search Everywhere
0 Next.js Support
0 Plugin DevKit
0 Bytecode Viewer
0 Gradle-Java
0 Projector Libraries for Code With Me and Remote Development
0 Maven Extension
0 com.intellij.dev
0 IntelliLang
0 JetBrains maven model api classes
0 Gradle Extension
0 com.intellij.tracing.ide
0 Gradle Dependency Updater Implementation
0 JavaScript Intention Power Pack
0 macOS Light Theme
0 W3C Validators
0 Gradle DSL API
0 Vite
0 Solarized Themes
0 Remote Development Server
0 Maven server api classes
0 WSL File System Support
0 Project Wide Analysis for Java
0 Tailwind CSS
0 ML in Search Everywhere for Microservices
0 JetBrains Repository Search
0 Machine Learning Code Completion Models
(I just copy-pasted from this table from the IntelliJ UI and that little awk script at the beginning moves the last time column to be the 1st, so it's more readable as plain-text.)#2022-09-2605:07onetomim also curious, how would u measure this startup performance.
would u use the async-profiler or yourkit?
it would be exciting to see a few notes / screenshots about how do u go about investigating something like this, even if u can't improve the performance.
just a few sentences would already be inspiring; i wouldn't expect a technology deep-dive.#2022-09-2605:13onetomHere is an example from our project, where I was looking into our usage of the https://github.com/oliyh/martian library.
Under the hood we happen to traverse the whole HTTP request payload 4 times with clojure.walk, which can take seconds, when the payload is tens of thousands of Google Sheets spreadsheet cells.#2022-09-2605:14onetommore precisely, 3 times with clojure.walk and 1 time with clojure.data.json#2022-09-2605:23onetomI just checked the plugin startup times in the release version (`2022.2.2`) of intellij and those are much better, so probably it doesn't worth worrying about the startup time:
592 Cursive
274 AWS Toolkit
183 Database Tools and SQL
170 JavaScript and TypeScript
75 Git
75 Grazie
58 Package Search
56 Python
40 Shared Indexes
35 Maven
24 PlantUML Integration
18 DOT Language
18 IDE Settings Sync
16 CSS
15 .ignore
13 FTP/SFTP/WebDAV Connectivity (ex. Remote Hosts Access)
11 EditorConfig
9 YAML
8 Configuration Script
8 Markdown
...
here some more exact version numbers:
IntelliJ IDEA 2022.2.2 (Ultimate Edition)
Build #IU-222.4167.29, built on September 13, 2022
Licensed to Tamas Herman
Subscription is active until November 26, 2022.
Runtime version: 17.0.4+7-b469.53 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.6
GC: G1 Young Generation, G1 Old Generation
Memory: 2000M
Cores: 8
Metal Rendering is ON
Registry:
documentation.show.toolbar=true
Non-Bundled Plugins:
some.awesome (1.14)
ski.chrzanow.foldableprojectview (1.1.3)
org.plugin.dot.id (1.4.1)
org.jetbrains.plugins.rest (222.4167.21)
org.jetbrains.plugins.localization (222.4167.21)
org.intellij.RegexpTester (1.0.8)
nix-idea (0.4.0.5)
name.kropp.intellij.makefile (222.4167.21)
de.dieploegers.develop.idea.shellfilter (4.3.0)
com.yanncebron.intellipikchr (0.3.1)
com.intellij.javafx (1.0.4)
com.github.b3er.idea.plugins.arc.browser (0.32)
com.4lex4.intellij.solarized (2.4.0)
mobi.hsz.idea.gitignore (4.4.2)
PlantUML integration (5.17.1)
com.cursiveclojure.cursive (1.12.5-eap2-2022.2)
com.intellij.plugins.html.instantEditing (222.4167.21)
com.dmarcotte.handlebars (222.4167.21)
Pythonid (222.4167.37)
ru.adelf.idea.dotenv (2022.2)
aws.toolkit (1.51-222)
com.github.pshirshov.bytecodeeditor (0.2.1)
AceJump (3.8.8)
AWSCloudFormation (222.4167.21)
Kotlin: 222-1.7.10-release-334-IJ4167.29#2022-09-2605:23onetomunless those startup times will be the new norm in intellij 2022.3...#2022-09-2905:30cflemingCursive takes the most time to initialise, mostly because it uses Clojure - Clojure’s startup time is a well-documented problem. I have a plan to defer actually loading Clojure until something requiring Cursive is performed, so that e.g. opening a non-Clojure project should not cause that to happen. It’s a long-term, ongoing project though.#2022-09-2608:03tlonisthow can I apply vertical align for let bindings where there is a destructuring?
(let [{:keys [id]} users ; this line cannot be vertically aligned
a [1 2 3]
b {:a :b :c :d}] ...)#2022-09-2608:48onetomindeed the Align let-binding values suggests that the destructuring form would be aligned too, but i can imagine it being an exception from the rule, because such destructuring forms would push other, simpler binding so far to the right, that it would become hard to see which symbol is bound to which value.#2022-09-2609:09tlonistso I'd like to know if there is any forcible way for cursive users to do this. Do you have any idea?#2022-09-2905:27cflemingThere isn’t at the moment, no. Destructuring elements are excepted from the rule, because they tend to be very long. But they’re not always, as in your case. This has been discussed before, I’ll see if I can dig up the discussion.#2022-09-2614:45Dustin GetzIs the Cursive extension "clojure-extras" considered standard at this point? I didn't even know about it#2022-09-2614:52imrecompletely independently developed afaik, see #clj-extras-plugin#2022-09-2816:26souenzzocursive can't resolve or vars inside destructure in reify
it is supported by /cdn-cgi/l/email-protection not sure about cljs.#2022-09-2816:27souenzzohere the code
(clojure.core.protocols/coll-reduce
(reify clojure.core.protocols/CollReduce
(coll-reduce [this {:keys [x]
:or {x 42}}]
x))
{})
it returns 42#2022-09-2905:31cflemingThanks for the repro case, I’ll check that.#2022-09-2909:57Thanh NguyenHi. When I try to press "Add as Clojure Deps project", I got a error notification "Cannot execute: Clojure command not configured" from Cursive. What should I do in this case? I fiddled around with the project configurations and stuff, but nothing seems to be the case here#2022-09-2911:40Thanh NguyenSorry for not researching more carefully. Basically I have to configure the Build Tool to let Cursive now how to invoke clj. I did it and things seem to work fine now#2022-09-2919:52kwladykais it possible in Curisve to print something like progress bar, but keeping it updating instead of print new line with each change?
something like:
1% which after a while change into 2% instead of
1%
2%
3%
…#2022-09-3009:49Ivar RefsdalYes, that's possible...
You can use
(str \u001b "[1K")
instead of the usual \r
and use
(str \u001b "[0K") for clear to end of line#2022-09-3009:53Ivar RefsdalExample autoclosable ticker-thingie I've used tor Cursive:
https://gist.github.com/ivarref/e50b7906f0e50c2129781c2ec87e7eb2#2022-09-3009:53Ivar RefsdalI did turn it off though, don't remember why.#2022-09-3009:54Ivar RefsdalCode is slightly modified from: https://github.com/ivarref/clj-paginate/blob/main/test/com/github/ivarref/clj_paginate/ticker.clj
which have some basic tickers for performance tests#2022-09-3009:58Ivar Refsdaland issue: https://github.com/cursive-ide/cursive/issues/2555#2022-09-3010:38kwladykaThank you#2022-09-3020:16kwladykaDoes (str \u001b "[1K") work outside cursive?#2022-10-0116:22Ivar RefsdalYes I think so#2022-10-0123:16cflemingYes, Cursive interprets a limited set of escape codes.#2022-10-0123:16cflemingIt’s far from a full terminal interpreter, but simple cases like this should work ok.#2022-10-0708:56onetomis it any better to use \u001b instead of "\033"?
eg:
(def cr
"Carrige Return as ANSI escape sequence"
"\033[1K")
(println (str "Hello" cr "World"))
#2022-09-2919:53kwladykaI would like to have some progress information when process large data#2022-10-0110:55kingmobIs there a way to disable Cursive’s built-in linting? I work on Aleph, which uses many funky potemkin macros, and I’m trying to cut down on the number of false positives I see.
I’ve sort of got kondo configured to the point where it’s ignoring what I want it to, but I’m still getting a lot of spurious warnings from Cursive itself. (The “resolve as” functionality doesn’t cut it.)#2022-10-0113:38imreSee the inspections panel of intellij settings#2022-10-0114:14kingmobAhh, thank you#2022-10-0114:28NoahTheDukeCould also use #clj-extras-plugin to get better clj-kondo support within cursive#2022-10-0203:55cflemingI’ll take a look at Aleph again, back in the day I did add support for Potemkin, but perhaps that got broken.#2022-10-0203:57kingmobThanks, Noah, I already use it. The issue is kondo now understands certain Potemkin things correctly, but Cursive doesn’t, so I need to disable its linting. #2022-10-0203:57kingmobThanks, @U0567Q30W #2022-10-0204:05cfleming@U10EC98F5 Just to be clear, do you get these errors when writing apps which use Aleph, or when working on Aleph itself?#2022-10-0206:18kingmobWorking on Aleph itself. I’m the current maintainer#2022-10-0206:18kingmobAlong with a couple others.#2022-10-0221:26cflemingHmm, yeah, it’s possible that might not work as well - I did put some effort into ensuring that projects using Aleph would work. I’ll take a look at Aleph them.#2022-10-0608:22kingmobFWIW, there’s a few proto-potemkin fns/macros here and there in Zach’s codebase, and they’re not always the same 😬 as the potemkin versions.#2022-10-0412:19roklenarcicI think Cursive falsely reports dependency cycles, when two namespaces include each other with :as-alias option. The app works, but when I try to load namespace into REPL with CMD+Shift+L it says there’s a dependency cycle.#2022-10-0418:56cflemingI’ll check this, thanks.#2022-10-0516:26antonmosHello! When I use the debugger, i have to hit “step into” up 3 times to get to the next line of code.
I also cant set breakpoints in let bindings.
I also sometimes see that the debugger go to the else form of if and then goes back to the “then” form.
I dont see any of these issues in github. Does anyone else have these issues?#2022-10-0522:44cflemingAs Alex mentions, this is to do with how Clojure compiles to bytecode. I’m planning to discuss this with JetBrains to see if I can work around it, but I haven’t done so yet.#2022-10-0522:44antonmosThank you for clarifying!#2022-10-0805:19cflemingI’ve filed this issue as a catch-all for these sorts of problems: https://github.com/cursive-ide/cursive/issues/2739. I’d like to get some simple repro cases in there I can take to JetBrains, I’ll try to come up with some next week but if anyone else has any drop them either here or over on the issue.#2022-10-0517:20Alex Miller (Clojure team)A lot of this has to do with how Clojure code is translated into bytecode with source mappings#2022-10-0517:24Alex Miller (Clojure team)I have definitely seen some of those issues#2022-10-0611:03danmOne of my colleagues has just introduced me to a cool IntelliJ feature that I'd not come across before. F6 in a file loads up a dialog with all of the functions/classes in that file (in Java, Python, TypeScript etc), and asks which ones you want to move to the new file location. Then it intelligently finds all the references to those functions/classes and updates them to import from the new location. F6 on a Clojure file in Cursive just gives a much simpler "Move File" dialog, and doesn't even update the namespace in the file to represent the new file system path (just warns you when you open it in the new location).
Is there something I need to enable to get the enhanced functionality in Cursive? And if it's just not supported yet, is there somewhere I can officially request it as a feature?#2022-10-0700:09cflemingThis is something that isn’t in Cursive yet, but I should be able to do it now. This feature relies on being able to reliably rewrite ns forms, which was only added to Cursive recently.#2022-10-0611:04danmDuring refactors it'd be really handy to be able to automatically move forms to a new namespace and add references to that namespace where the old was was imported and the forms used. Even if it only did it as a full ns import rather than trying to guess a reasonable :as#2022-10-0618:49devurandomHi! When right clicking a deps.edn file, there is a "Add as Clojure Deps Project" menu entry. How do I undo that? Is there a "Remove Clojure Deps Project" somewhere? I already tried clicking the project root folder and "Open Module Settings", but cannot find anything that seems related.#2022-10-0618:54danmIn the view -> tools menu (or is it toolbars? On phone right now), there is a Clojure deps projects sidebar. The option to display it only appears if you actually have a Clojure deps project set up in the current IntelliJ workspace. You can delete it from in there#2022-10-0618:55devurandomThanks a lot!#2022-10-1017:32danmWhat's the chances of Cursive being made to parse templated strings from clojure.core.strint? We quite often use << from that module, and at the moment Cursive tells us that all our bindings which are only used within the templated string are unused.#2022-10-1103:17cflemingHmm, I’m not sure about that, it looks like it’s been incubating since 2012. Can you give me a simple example of something that doesn’t work correctly?#2022-10-1218:58danmFair. I’ve been told by @U09LZR36F that it is very much “here be Dragons” territory that is unlikely to ever move into core proper (as, for example, I discovered that
(let [a “foo”]
(<< “test ~{a}”))
interpolates properly, but
(let [a “foo”
tmpl “test ~{a}”]
(<< tmpl))
totally doesn’t), so it might well not be worth your time.
Anyway, if it is, it’s simply a case that Cursive would grey out the a var in the let binding as unused in my first (i.e. working) example above, because it doesn’t recognise the ~{a} within the string arg to << as a use of the var.#2022-10-1219:00danmSemi-related, but non-Cursive: how the hell do you turn off smart quotes on iPhone? ;)#2022-10-1021:04ChrisHey, when doing
(require '[java-time :as jt])
cursive will often complain that jt can’t be resolved and won’t offer completions. Is this happening to anybody else? Do I need to restart something to get it recognized?#2022-10-1103:18cflemingIs java-time added to your project correctly? Can you see it in External Libraries in your project view?#2022-10-1106:15Chrisyes, it’s in project.clj and in external libraries as well
EDIT: I can also use the functions from java-time in the REPL#2022-10-1106:21ChrisI also get this behavior for org.httpkit.client which I’m refering to as http: http/post cannot be resolved#2022-10-1120:12cflemingCan I look at your project, is it public?#2022-10-1208:35ChrisI made a minimal project for you here: https://github.com/jakuzure/cursive-intellij-unresolved-minimal
after creating the new project I was asked to generate stubs, which I did, after that java-time aka jt was resolved correctly and also fixed in my previous project. I still get the same behavior for httpkit though#2022-10-1107:45simongrayHaving a #?(...) in a let form inside a CLJC file seems to break Cursive’s ability to resolve the remaining symbols in the let form:#2022-10-1112:56seriogaThe workaround is
?#@(:clj [state' {}] :cljs [state' (rum/react state)])#2022-10-1120:55hlshipDoes cursive care about a pom.clj file somehow? I have a project I've inherited that generates a pom.xml from a pom.clj and Cursive appears to be stumbling on it with a parse error. Once I delete the file, Cursive is able to load pom.xml successfully.#2022-10-1120:55hlship#2022-10-1121:13hlshipRenaming pom.clj to pom-template.edn appears to fix this; now I just have to make the rest of the team accept the change.#2022-10-1200:41cflemingI can’t find or remember anything in Cursive that treats that file specially.#2022-10-1200:43cflemingLooking at the stacktrace, it actually looks like the Maven support is picking it up for some reason.#2022-10-1202:23Ian FernandezAnyone has used Lein-monolith in IntellijIdea?#2022-10-1202:23Ian FernandezHow is the integration for it?#2022-10-1206:32eskosIIRC Cursive does nothing special with it, so practically no integration.#2022-10-1219:14Roman OstashHi,
Are there any plans for porting/writing Cursive plugin for JetBrains Fleet?
IDE looks very promising so far.
https://www.jetbrains.com/fleet/#2022-10-1220:54cflemingTotally unknown at this point. There’s no plugin API yet or any information at all about what plugin development will be like. It’s likely to be a non-trivial amount of work since the UI layer is completely different, and I’ll have to get some idea of how popular Fleet is likely to be to make a judgement call about whether it’s worth it.#2022-10-1302:54onetomfor its supposed, turn-key collaborative capabilities, im also very interested in Fleet.
i've tried it recently, but it also eats shitload of memory and its startup time is non-trivial, so im a bit disappointed in it at the moment, BUT i guess the developers are aiming for a better architecture and the usage of more modern OS & graphics APIs first and perf and resource utilization optimization will come a lot later.
for now, they are probably aiming for being only just noticably better than intellij.#2022-10-1415:50Roman OstashThat makes sense. Fleet is still in early stages of development.
Thank you for the update!#2022-10-1303:06onetomif i have a function with a multi-line argument list, eg:
(defn handle-auth
[{:as req
requesting-user :xxx/user
claims :jwt/claims
params :body-params}])
it appears in the Structure tool window and the File Structure popup on a single line.
the newlines are removed from the function signature, BUT the spaces are not compacted, so it makes those windows horizontally scrollable, which is annoying.
also, i can't see the full arg list, without scrolling to the far right.
i think this format would be more useful:
(-> '[{:as req
requesting-user :xxx/user
claims :jwt/claims
params :body-params}]
pr-str)
=> "[{:as req, requesting-user :xxx/user, claims :jwt/claims, params :body-params}]"#2022-10-1303:08onetommaybe sprinkled with some unicode chars for even better readability:
(str/replace #"," " ·"))
=> "[{:as req · requesting-user :xxx/user · claims :jwt/claims · params :body-params}]"#2022-10-1401:20onetomfor the record, I've just tried to use https://github.com/borkdude/deps.clj with Cursive instead of the official Clojure CLI tool.
it worked out of the box for our projects.
not sure what the benefits of it would be, because it seems to run just as slow/fast as the Clojure CLI.#2022-10-1401:23onetomClojure CLI
===========
1st run, without ./.cpcache:
❯ rm -rf .cpcache/ ; time clojure -M:test:dev -e 1
1
clojure -M:test:dev -e 1 4.60s user 0.21s system 280% cpu 1.714 total
2nd run, using ./.cpcache:
❯ time clojure -M:test:dev -e 1
1
clojure -M:test:dev -e 1 1.40s user 0.08s system 201% cpu 0.734 total
deps.clj
========
1st run, without ./.cpcache:
❯ rm -rf .cpcache/ ; time deps -M:test:dev -e 1
1
deps -M:test:dev -e 1 3.97s user 0.26s system 248% cpu 1.703 total
2nd run, using ./.cpcache:
`
❯ time deps -M:test:dev -e 1
1
deps -M:test:dev -e 1 1.28s user 0.08s system 201% cpu 0.675 total#2022-10-1407:44borkdude> because it seems to run just as slow/fast as the Clojure CLI.
The benefit is that you can use it as a binary on Windows which solves some problems that exists there with Powershell.
When you have an already running JVM, and load this as a library, then it would still be "just as fast" as the clojure CLI since the startup time of the bash CLI or deps binary is neglectible. A JVM is started once to calculate the classpath / download deps but for the same set of dependencies it is cached.#2022-10-1516:44onetombut in the examples above, i didn't have an already running JVM and didn't have .cpcache either, yet running clojure took about the same amount of time (`1.7s`) as running deps.
which is a pretty good time, but I remember clojure taking a lot longer in the past...#2022-10-1516:45onetomi have the feeling that my test methodology is flawed somehow#2022-10-1516:49borkdudeclojure and deps are expected to be roughly equally as fast. the most time taken is by the jvm is launched, the rest is just shell or executable checking the cache and starting java, which takes just a few ms#2022-10-1516:49onetomgood to know about the windows support of deps. I'm consciously avoiding Windows, but if I ever need to program on it again, deps.clj will certainly be the 1st thing I install on it! :)#2022-10-1516:50onetomor babashka, right away :)#2022-10-1516:58onetomfor the sake of completeness, here is a baseline run of clojure on the same 2020 M1 Mac mini, where the execution times above came from:
❯ rm -rf ./.cpcache ; time clojure -M -e 1
1
clojure -M -e 1 0.49s user 0.05s system 165% cpu 0.327 total
❯ time clojure -M -e 1
1
clojure -M -e 1 0.50s user 0.05s system 164% cpu 0.337 total
#2022-10-1517:01onetomwaaaait a second, deps is not an ARM binary!
❯ file $(which deps)
/Users/onetom/bin/deps: Mach-O 64-bit executable x86_64
so it was an apple to oranges comparison!
sorry, my bad.
there is not ARM version of deps.clj yet, right?#2022-10-1517:55borkdude@U086D6TBN Ah good call. Try bb clojure instead, there is an arm binary for that. deps doesn't have one at the moment, but could be made (if enough people ask)#2022-10-1517:55borkdudebb clojure ...
is essentially the same as
deps ...
#2022-10-1703:48onetomindeed with bb clojure, instead of deps, the runtime is 0.4s/`0.2s` less:
❯ rm -rf .cpcache/ ; time bb clojure -M:test:dev -e 1
1
bb clojure -M:test:dev -e 1 4.73s user 0.28s system 364% cpu 1.375 total
❯ time bb clojure -M:test:dev -e 1
1
bb clojure -M:test:dev -e 1 1.16s user 0.08s system 215% cpu 0.577 total
#2022-10-1401:31onetom@cfleming how come, when I run a local clojure run config with Run with Deps option, there is no ./.cpcache/* is generated (yet, the REPL starts up surprisingly fast)?
I use the Use CLI tools (recommended) setting, with Path to 'clojure' command being /nix/store/lfrdycq43509a9s7m6dk7m4jscmaq7qf-clojure-1.11.1.1149/bin/clojure.
and when i run rm -rf ./.cpcache ; clojure -M:test:dev -e 1, which is theoretically equivalent to the intellij run config, it does generate a ./.cpcache/*.#2022-10-1401:35cflemingCursive actually doesn’t do any caching of the classpath for run configs at the moment, although it’s something that I’m planning. It does do it for deps project sync, but not for lein.#2022-10-1415:32folconIs there any way of exporting indentation config in cursive to use as a git commit hook or something so I can get some of the nice indentation rules that we have consistently applied inside the codebase?#2022-10-1415:56tanzoniteblackif you have a script that reformats your file, you can always set that up as an “after save” hook in intellij#2022-10-1415:57tanzoniteblacklook for “Actions on save” in the settings menu#2022-10-1615:37folconAh, that's not quite what I meant, I think cursive's indentation is pretty good, I want to run it or something equivalent as a command line hook.#2022-10-1703:09cflemingIntelliJ does support a command line formatter, see https://www.jetbrains.com/help/idea/command-line-formatter.html. However it starts a whole IntelliJ instance to do it, so it may not be a great option for what you want. A better option would probably be to come up with the corresponding cljfmt config, and just run that.#2022-10-1713:58folconHmm, ok I'll dig into cljfmt, thanks @cfleming!
Out of curiosity, does cursive's indenter use the same approach or is it compatible with cljfmt?
I quite like what you're doing / options you offer, so being able to do something similar would be good.#2022-10-1717:27Ivar RefsdalThere is also zprint: https://github.com/kkinnear/zprint#get-zprint
Which has a graalvm binary that starts in under 50 ms if you want fast(er) feedback..#2022-10-1717:27Ivar RefsdalI haven't tried either myself#2022-10-1720:16cflemingSo Cursive doesn’t use the same approach as cljfmt, but I believe they should be able to be made pretty compatible. Let me know if there are things you’d like to achieve but can’t. zprint is also an option, although it’s extremely configurable - philosophically, I think it’s too much and prefer tools with the minimum of config required to achieve a sane result.#2022-10-1418:19Mark MacDoes Cursive support Jetbrains Gateway?#2022-10-1505:40onetomsome related tickets:
1. https://github.com/cursive-ide/cursive/issues/2721
2. https://github.com/cursive-ide/cursive/issues/2533
and i think there was one more at least.
i tried jetbrains gateway, when it came out and it didn't support opening the REPL window at that time and i doubt it has changed.#2022-10-1507:25Mark MacThanks, 2721 sounds like the issue I'm facing. Will watch the ticket.#2022-10-1703:09cflemingI haven’t had a chance to get to this yet, sorry.#2022-10-1710:15Mark Mac@cfleming the following announcement might trigger more interest https://blog.jetbrains.com/idea/2022/10/remote-development-in-jetbrains-ides-now-available-to-google-cloud-workstations-users/ possibly making it worthwhile fixing this problem. Thanks.#2022-10-1806:47JAtkinsAny idea how to prevent IJ from inserting hard breaks within strings?#2022-10-1810:02imreperhaps?#2022-10-1815:15JAtkinsah, thank you. I didn't find that when looking last night. It would be nice if cursive told IJ that formatting was sensitive in strings, but I don't think I care enough about the feature to say either way 🙂#2022-10-1819:57Ian FernandezHi, how can I start a REPL with lein monolith#2022-10-1819:57Ian Fernandezas I use
lein monolith with-all repl
in my machine it occurs ok#2022-10-1819:57Ian Fernandezbut#2022-10-1819:59Ian Fernandez#2022-10-1913:40the-alchemistDid you try “Run With Leiningen” instead of “Run with IntelliJ project classpath”?#2022-10-1913:42Ian Fernandezyeah, it had the same problem#2022-10-1819:59Ian FernandezI’m having this problem#2022-10-1819:59Ian Fernandezfor Run Configuration error#2022-10-1922:18hlshipHere's an odd question: I'm trying to make io.aviso.pretty smarter about when to emit ANSI escape codes, and when not to. I have a default based on whether (System/console) returns non-nil. This works well for clj and does the right things in pipes and background jobs (it will be nil, so no ANSI). However, in a REPL launched by Cursive, console is still nil. Is there another cheap test I can make to determine if in a Cursive-launched REPL? Otherwise, I have to lean on setting an environment variable to override the console check.#2022-10-2016:58hlshipHad the idea of checking loaded namespaces and saw cursive.repl.runtime may be a good indicator of running under Cursive.#2022-10-2107:35Ivar RefsdalI've used
(def is-cursive?
(try
(require '[cursive.repl.runtime])
true
(catch Exception _
false)))
successfully before.
Not sure if it's the best solution#2022-10-2110:56flowthingYou could probably just do (find-ns 'cursive.repl.runtime).#2022-10-2417:39hlshipUltimnately, I looked for nrepl.core (see https://github.com/AvisoNovate/pretty/blob/master/src/io/aviso/ansi.clj#L35) as this worked for Cursive and for lein repl and for clj. It probably works for Emacs and other editors too, I have to assume that those can handle ANSI color/font codes.#2022-10-2116:16Jared LangsonGot a REPL question. I have anonymous functions defined in a let binding. When I try to send a piece of code inside the let binding to the repl it tells me that the var is undefined. I've used "Load File in REPL". Is there a way to use the repl with let forms? The code
(let [get-tile-values (fn [m n] (str (get-in m [:resources n]) " " (get-in m [:rolls n])))
get-tile-css (fn [m n] (color-classes (str (get-in m [:resources n]))))]
[:div.grid.grid-cols-5.gap-1
[:div.text-white.text-center.p-2 (get-tile-values m 1)
{:style {:class (get-tile-css m 1)}}]
;...
When I try to use the send X to REPL command it says it can't find the var. For example send (get-tile-values m 1) to REPL results in a "Use of undeclared Var front-end.views/get-tile-values" error message#2022-10-2116:19imresend top form to repl#2022-10-2116:21imretry that#2022-10-2116:22Jared LangsonTried that and got the same error. I used send (defn map->grid) to repl. Running the functions declared inside the let binding gives the same error#2022-10-2116:22imretry sending the entire let form#2022-10-2116:24imreif there is no namespace-wide binding of get-tile-values then when you send (get-tile-values m 1) , clojure won't know what you mean by get-tile-values#2022-10-2116:24imreor m for that matter#2022-10-2116:24Jared LangsonI manually loaded m into repl from a comment#2022-10-2116:25Jared Langsonsending the let form still doesn't let me use the methods declared inside the let#2022-10-2116:25Jared LangsonI can declare the functions globally, but that's a workaround#2022-10-2116:26imre> sending the let form still doesn't let me use the methods declared inside the let
you mean you send the let form and it errors out?#2022-10-2116:26imreor you send the let form and then you try to send (get-tile-values m 1)?#2022-10-2116:27Jared Langsonthe second. I can send the let form fine, but when I call the (get-tile-values m 1) it errors#2022-10-2116:27imrebindings established in the let form are only available in the let form#2022-10-2116:28imrethat's why it doesn't work#2022-10-2116:28Jared LangsonI'm using the send at cursor function. Even though my cursor is inside the let form, it has no knowledge of the let form's binding?
(let [get-tile-values (fn [m n] (str (get-in m [:resources n]) " " (get-in m [:rolls n])))
get-tile-css (fn [m n] (color-classes (str (get-in m [:resources n]))))]
[:div.grid.grid-cols-5.gap-1
[:div.text-white.text-center.p-2 (get-tile-values m 1)
{:style {:class (get-tile-css m 1)}}]#2022-10-2116:29imreyeah so when you say send let form, that will send your entire let form#2022-10-2116:29imrebut when from inside the let form you send (get-tile-values...) then it will literally send only that#2022-10-2116:29imrethat's akin to typing#2022-10-2116:30imre`(let [myfn ...]#2022-10-2116:30Jared Langsondang. What's the best way to use the repl for testing anonymous functions in let bindings? The only thing I can think of is declare them globally during development and move them into let for production#2022-10-2116:30imreyou can comment out the body of the let form and only make the body the form you want to evaluate in the scope of that let form#2022-10-2116:31imreand then send the let form in#2022-10-2116:31imreso (let [...] (get-tile-values m))#2022-10-2116:31imreor you can go#2022-10-2116:32imre(let [get-tile-values ...]
(def get-tile-values get-tile-values)
...
)
#2022-10-2116:32imreand then#2022-10-2116:32imre(get-tile-values m#2022-10-2116:32Jared LangsonAppreciate it. Thanks!#2022-10-2116:34imrejust make sure you don't check in the inline def#2022-10-2116:34Jared LangsonSuper helpful. Thanks a lot 🙂#2022-10-2116:35imreyw, good luck#2022-11-0212:48apbleonard@U01ES0TF6V6 I've used this macro in the past for exactly this problem. In the repl you just make sure you have switched to the namespace of your editor, type (deflet []) and cut and paste the let bindings you want to "inline def" as its first argument (i.e. replacing the empty vector.) The macro will inline def them all for you so you can get on with the repling. Much quicker for large let blocks. https://gist.github.com/henryw374/5dfcbf9d27ec89b360058e81339cbe4e#2022-11-0212:52apbleonardWhen inline defing a lot it can be useful to "zap" the namespace a la https://clojurians.slack.com/archives/C0744GXCJ/p1667378949616179 :)#2022-11-0215:54Jared Langson@U3TSNPRT9 with deflet, could it also work if I changed let to deflet in the function? And then I could change it back to let when I was done messing with it?#2022-11-0215:56Jared LangsonWhat's the advantage of zapping? I can reload the file and I can def the vars a second or third time. I tend to throw things in comment blocks so I can quickly reload useful snippets.#2022-11-0217:39apbleonardChanging let to deflet might indeed work - never tried that! If you reload it won't "forget" anything previously "def'd". That's why to really clean up you have to "zap" or restart the repl. Reloading also doesn't drop other things like aliases you previously defined in your ns requires. Swapping aliases in your requires can similarly leave you unable to reload completely.#2022-10-2407:11steveb8nQ: I’ve started using a babashka repl. has a few rough edges but overall it’s going well. I’ve hit a problem with deps - I have a :git/url dep that works via the bb task runner but is not available via the REPL. How does the Cursive bb repl calculate the classpath and resolve deps?#2022-10-2407:12steveb8nI’ve tried using deps.edn. didn’t fix it#2022-10-2407:12steveb8nAlso tried using bb.edn (because it’s docs say that it can manage deps for a REPL) but no luck that way either#2022-10-2407:39cflemingHmm, I’m not sure on this one, will try that out tomorrow.#2022-10-2408:06steveb8nthanks. I can workaround by invoking from the terminal for now#2022-10-2408:32steveb8nit appears to be :git/url specific. if I add a normal clojars dep to bb.edn the repl loads/includes it#2022-10-2408:37steveb8nhmm, not sure about that either. worked for zprint git dep but not for my own git repo. I’ll dig deeper tomorrow as well#2022-10-2518:37dvingoanyone have tips for setting *print-namespace-maps* to false for all REPLS? (clj and cljs)#2022-10-2703:00onetomi was trying put the following into my src/user.clj:
(alter-var-root #'*print-namespace-maps* (constantly false))
(prn {:asd/qwe 123 :asd/zxc 456})
and when i start a cursive local repl, it indeed just prints {:asd/qwe 123 :asd/zxc 456}, BUT
1. if i comment out the alter-var-root, it still prints the same
2. when eval the prn form manually, it prints the undesired #:asd{:qwe 123, :zxc 456}, regardless of whether the alter-var-root is commented out or not
i haven't tried this in an isolated project yet, though, so i might have some interference from other libraries.#2022-10-2715:24dvingothanks I'll try that out as well. I know how to affect printing maps by binding the var, but the output in the REPL pane is still using namespace maps 😞#2022-10-2703:23cjsauerIs it possible to evaluate a form in the buffer, and have its result replace the form itself?
For example, say I have (random-uuid) in the buffer. What I want is for that form to replaced by #uuid"c1ebe545-11a0-46ce-a047-263138a59451" for example.#2022-10-2708:50cflemingIt isn’t right now, sorry. I have a plan to extend the REPL commands to allow things like this, so you would be able to build commands to do the things you want along these lines. But I haven’t got to that yet.#2022-10-2711:34cjsauerNo worries. Looking forward to the new REPL features. #2022-10-2721:02cfleming@U6GFE9HS7 Actually, something similar was discussed a while ago, with a nice solution: https://clojurians.slack.com/archives/C0744GXCJ/p1644978986077219#2022-10-2721:07cjsauerOh nice!! That’ll work for now#2022-10-2714:43onetomi've monkey-patched kaocha, so it prints the stack traces for for test failures & errors in a way, that cursive can convert them into links back to the source code.
the output of https://github.com/nubank/matcher-combinators failures are also more readable after the expected & actual values are printed starting on a new line, from column 0, so multi-line values are indented correctly.
https://gist.github.com/onetom/e39b8cc67d97e9afe3d7b2199024a84b#2022-10-2715:57imreThis is nice. Have you thought about contributing this to kaocha proper?#2022-10-2716:01imrekaocha is nicely pluggable, I could imagine this possible as a plugin#2022-10-2717:21onetomi thought just enough about it to get it working and that already took more time, than what i should have spent on it right now 🙂
i saw, that the kaocha.report/print-expr is a multi method of the 1st symbol of the assertion expression (just like clojure.test/assert-expr), so i should have probably just do a (defmethod print-expr 'match? [m] ...) to only affect the matcher-combinator output.#2022-10-2717:22onetombtw, i've tweaked things further a bit and now the expected form is pretty-printed as code, with clojure.pprint/pprint, so u should check out the latest version of the gist.#2022-10-2717:25onetomit would be nicer, if Cursive would have more relaxed rules for recognizing stack trace elements and i shouldn't put that single trace on a newline after FAIL or ERROR...#2022-10-2717:28onetombut not sure how would that affect the performance of the REPL window, if the stack trace pattern would be something like #".* (at|in) ...", instead of the current, presumably #"^ at ...".
though, it does recognize the output of https://github.com/mmcgrana/clj-stacktrace too.#2022-10-2718:26imrealso works with https://github.com/AvisoNovate/pretty#2022-10-2800:23cflemingYes, this is just something I’d have to add to Cursive. It’s possible that it could be made generalisable (i.e. using user-defined patterns or something) but I’d have to investigate that.#2022-10-2800:24cflemingIt’s also true that multi-line patterns are hard in IntelliJ (which is annoying for e.g. printed error objects)#2022-10-2715:20onetomExample of enhanced Kaocha + matcher-combinators + Cursive output:#2022-10-2716:56onetomi've also managed to include the name of the tests, defined by clojure.test/deftest, into the stacktrace output, using this small tweak:
(alter-var-root
#'clojure.test/deftest
(constantly
(fn deftest
[&form &env name & body]
(when clojure.test/*load-tests*
`(defn ~(vary-meta name assoc :test `(fn ~name []
it will print
at demo.better_deftest$enhanced_stack_trace_test__600.invokeStatic (better_deftest.clj:19)
demo.better_deftest/enhanced_stack_trace_test (better_deftest.clj:19)
instead of the default anonymous fn:
at demo.better_deftest$fn__513.invokeStatic (better_deftest.clj:4)
demo.better_deftest/fn (better_deftest.clj:4)
#2022-10-2716:57onetomcomplete test code to repro this result:
(ns demo.better-deftest
(:require [clojure.test :refer :all]))
(deftest default-stack-trace-test
(is (throw (Exception. "BAMM"))))
(clojure.test/run-test default-stack-trace-test)
;;; `clojure.test` improvements
(alter-var-root
#'clojure.test/deftest
(constantly
(fn deftest
[&form &env name & body]
(when clojure.test/*load-tests*
`(defn ~(vary-meta name assoc :test `(fn ~name [] #2022-10-2717:23imreI wonder if there's a clj ticket about this#2022-10-2717:29onetomyeah, i thought about that too, but hasn't dug into it yet.
im not very confident, whether this change could cause any issues, but our test suite seems to run with it at least.#2022-10-2719:03imreLooks like https://clojure.atlassian.net/jira/software/c/projects/CLJ/issues/?jql=project%20%3D%20%22CLJ%22%20AND%20text%20~%20%22deftest%22%20AND%20statuscategory%20%3D%20%22New%22%20ORDER%20BY%20created%20DESC - if this is something that is visible outside of kaocha it might be worth raising it on ask.clojure#2022-10-2812:00onetomthis one is slightly related though:
https://clojure.atlassian.net/browse/CLJ-2639#2022-10-2819:04kwladykaanyone find a way to use .envrc with Cursive?#2022-10-2821:11nwjsmithIt would probably be simple to add support to https://github.com/Fapiko/intellij-better-direnv#2022-10-2821:11nwjsmithI haven't been using it for Clojure projects, but works great in my other ones#2022-10-2822:01cflemingI’m not sure if this is the same thing, but Cursive does support https://github.com/Ashald/EnvFile#2022-10-2910:34kwladykathank you, the https://github.com/Ashald/EnvFile work
I added a comment here
https://github.com/cursive-ide/cursive/issues/2742#2022-10-2910:34kwladykaBetter direnv didn’t work for me for Cursive.#2022-10-3012:18onetombetter direnv needs every kind of run configuration supported by it and Cursive is not yet supported.
i use direnv to have a nix-shell environment for our Clojure projects, but what IntelliJ and the REPLs started from it, should be concerned about is only a few things, so in practice, I just setup the following manually:
1. clojure CLI path
(`which clojure`)
2. JDK path
(`which java`)
3. node & npm or yarn (`which node`)#2022-10-3010:16tskardalWhen starting cursive I get this error:
com.intellij.execution.ExecutionException: Cannot execute: Could not find :version in command output when executing /usr/local/bin/clojure
And I get zero results when searching for this error message 😬 – any suggestions?#2022-10-3102:32cflemingI can’t reproduce this, sorry. What do you get if you run clojure -Sdescribe?#2022-10-3105:07tskardalNo worries 🙂
Here’s the output:
❯ clojure -Sdescribe
{ version "1.11.1.1182"
config-files ["/usr/local/Cellar/clojure/1.11.1.1182/deps.edn" "/Users/thomas/.clojure/deps.edn" ]
config-user "/Users/thomas/.clojure/deps.edn"
config-project "deps.edn"
install-dir "/usr/local/Cellar/clojure/1.11.1.1182"
config-dir "/Users/thomas/.clojure"
cache-dir "/Users/thomas/.clojure/.cpcache"
force false
repro false
main-aliases ""
repl-aliases ""}#2022-10-3105:20cflemingHere’s what I see:
~/d/cursive (master)> clojure -Sdescribe
{:version "1.11.1.1182"
:config-files ["/opt/homebrew/Cellar/clojure/1.11.1.1182/deps.edn" "/Users/colin/.clojure/deps.edn" "deps.edn" ]
:config-user "/Users/colin/.clojure/deps.edn"
:config-project "deps.edn"
:install-dir "/opt/homebrew/Cellar/clojure/1.11.1.1182"
:config-dir "/Users/colin/.clojure"
:cache-dir ".cpcache"
:force false
:repro false
:main-aliases ""
:repl-aliases ""}#2022-10-3105:21cflemingSee how your keys are symbols rather than keywords? I think that’s the problem, but I have no idea why that would happen.#2022-10-3105:46cflemingIf you’re not sure why that might be happening, it would be worth asking over in #C6QH853H8#2022-10-3107:12onetom@U06DX1ANS i would probably upgrade or reinstall homebrew, because that's a bit suspicious, that your built-in deps.edn file is under /usr/local/ and not under /usr/homebrew/.
alternatively, i'd recommend using Nix instead of homebrew for managing non-GUI apps, because it yields in more reproducible environments.
u can even have multiple environments side-by-side, without affecting each other and it's also completely isolated from your homebrew installation or the built-in macOS programs.
just install with
sh <(curl -L ) --daemon
as described in https://nixos.org/manual/nix/stable/installation/installing-binary.html#multi-user-installation
(the install script explains very precisely what it will do and why)
then, in a newly opened terminal window, either try clojure temporarily with:
nix-shell -p clojure
which will downloads Clojure CLI tools for the 1st time, then starts a new bash shell, where clojure is on your PATH:
[nix-shell:~]$ clojure -Sdescribe
{:version "1.11.1.1177"
:config-files ["/nix/store/q6sxn9lcb5rj5b7rhrwqsk9p8fhr63xp-clojure-1.11.1.1177/deps.edn" "/Users/onetom/.clojure/deps.edn" ]
:config-user "/Users/onetom/.clojure/deps.edn"
:config-project "deps.edn"
:install-dir "/nix/store/q6sxn9lcb5rj5b7rhrwqsk9p8fhr63xp-clojure-1.11.1.1177"
:config-dir "/Users/onetom/.clojure"
:cache-dir "/Users/onetom/.clojure/.cpcache"
:force false
:repro false
:main-aliases ""
:repl-aliases ""}
or you can install it in a way, that's it's always available for your user:
nix-env -iA nixpkgs.clojure
then remove with
nix-env -e clojure
in case u want the homebrew version found first on your PATH again.#2022-10-3109:17cflemingIIRC (it’s been a while) I think brew on Intel installs binaries, at least, to /usr/local. I might be wrong on that, though.#2022-10-3119:54tskardalyes, symlinks are put in /usr/local/bin#2022-10-3119:55tskardalI’ve been using nix too, but not on macOS 🙂#2022-11-0219:43tskardalFYI, the problem was that I was using the default bash on macOS. The script behaves differently on a more recent one.
https://clojure.atlassian.net/browse/TDEPS-233#2022-11-0222:20cflemingGlad you found the answer! That was very weird indeed.#2022-10-3012:44tskardalI’ve tried both stable and EAP. This is macOS btw.
❯ clojure --version
Clojure CLI version 1.11.1.1182
❯ which clojure
/usr/local/bin/clojure
#2022-10-3116:14DumchFor guys who use Idea with IdeaVim. I wrote an https://www.reddit.com/r/Clojure/comments/yig9cu/vim_objects_for_forms_like_in_sexp_plugin_for/ on how to set up vim text objects for forms selection/deletion/changing with “f”.#2022-10-3121:46cflemingGreat use of LivePlugin, very nice!#2022-11-0100:21kwladykahttps://github.com/cursive-ide/cursive/issues/2743#2022-11-0208:49apbleonardAny thoughts about adding a REPL submenu item or similar to "zap" a namespace like this? https://github.com/seancorfield/vscode-calva-setup/blob/4399acdc762188df25fecd52436bb6b61efc9d90/calva/config.edn#L25 I know it's possible to similarly set up custom commands in Cursive, but it would really aid those starting out with REPL ing to be able to start afresh with a namespace that's gone bad, without having to constantly restart the REPL, which saps their faith in it.#2022-11-0308:23cflemingIt’s something I could think about adding, but really it seems like a good use case for the REPL commands to be honest. Perhaps a more general solution would be to have a good way of sharing REPL commands.#2022-11-0409:35apbleonard@U0567Q30W Custom REPL commands (bindable to keyboard shortcuts) are awesome, and power users need that for their preferred "refresh" workflows. But for new users Cursive has "out of the box" a core set of operations that is essential for using the REPL. I guess my feeling is that some opinionated choice of "refresh" or "clean" or "zap" namespace operation is "essential" for new users. It's well established in UX that the ability to start afresh is critical to usability - no matter the tool. Right now all new users have to start afresh is the REPL restart button, which you are told is a slow frustrating last resort - and yet they use it constantly - or worse they give up on the REPL entirely seeing it as unreliable. Clojure sells itself as a playful interactive experience, where learning is done by doing, but that only works if you can start afresh reliably. I work in an enterprise setting with a smattering of Clojure in a sea of Java, and a rolling set of partner staff who are not Clojure enthusiasts and may never be. They are not determined enough to read up on "tips and tricks" around the internet on how best to use the REPL and expect tooling guidance. Many are confused by the REPL and avoid it. So my plea is to consider helping to grow Clojure and the Cursive user base towards those non enthusiasts by adding a small feature that will help them start afresh :)#2022-11-0214:01EmpperiI got back to writing some Clojure code and I'm seeing a problem that was not there before. When executing tests in the REPL and getting test failures I do not get the gutter icon/inline results anymore in the editor. This makes the test execution in REPL almost useless since I do not get the assertion differences and information on which test failed. Anyone else seeing this?#2022-11-0214:09Jordan Robinsonit's now a context action, and can be bound to a keyboard shortcut, so you may see it with alt+enter#2022-11-0214:09Jordan Robinsonthough I've noticed if one of the sides is nil sometimes that doesn't show#2022-11-0214:09EmpperiDon't see it?#2022-11-0214:10EmpperiThere's literally nothing in the editor that shows I actually executed tests#2022-11-0214:10EmpperiI do get the small notification box#2022-11-0214:10EmpperiThis one#2022-11-0214:12Jordan Robinsonah that's a bit more significantly weirder, though I've seen a similar thing if your test file is named the same as a src file#2022-11-0214:12EmpperiDifferent name#2022-11-0214:13Jordan Robinsonthis is what it should look like when it fails#2022-11-0214:13EmpperiNope. If that would happen I would have not asked 🙂#2022-11-0214:14Jordan Robinsonsorry that meant to have this bit in with the context menu:#2022-11-0214:14EmpperiSo, it is a bug/issue and manifests on my system#2022-11-0214:14Jordan Robinsonyeah sorry, I don't have any other ideas#2022-11-0214:15EmpperiNo worries. Just wanted to know if it is turned off by default and can't just find the proper setting that would turn it on or something like that#2022-11-0214:15EmpperiBeen diving into settings#2022-11-0214:15EmpperiBut this does make executing tests with Cursive pain#2022-11-0214:17EmpperiI can execute a single test with that gutter icon but that executes the test in a separate jvm process which takes tons of time. In the output there's a link "click to see the differences" which opens the diff#2022-11-0214:17EmpperiTotally losing the fast iteration speed with REPL#2022-11-0214:17Jordan Robinsonyeah that's not great - if you start a new project with leiningen or similar and run the test that comes with that, does that work?#2022-11-0214:17Jordan Robinsoncould rule out the code vs the ide settings at least#2022-11-0214:18EmpperiI'll try that just to be sure, one moment#2022-11-0214:19EmpperiTotally blank project created from scratch with lein new testing-cursive and opened as a new project suffers from the same issue#2022-11-0214:20Jordan Robinsonwell that rules out a lot of stuff at least but I don't have any other ideas I'm afraid, maybe someone else in the channel does#2022-11-0214:20EmpperiYeah. I'll try to cope with this until someone might figure out wth is going on#2022-11-0214:20EmpperiI'm out of ideas myself too#2022-11-0214:30EmpperiJust in case Fleming happens to look at this or someone else with more knowledge, here is my about dialog content:
IntelliJ IDEA 2022.2.3 (Ultimate Edition)
Build #IU-222.4345.14, built on October 5, 2022
Licensed to Niklas Collin
Subscription is active until February 22, 2023.
Runtime version: 17.0.4.1+7-b469.62 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Non-Bundled Plugins:
org.jetbrains.kotlin (222-1.7.20-release-201-IJ4167.29)
mobi.hsz.idea.gitignore (4.4.2)
com.intellij.kubernetes (222.4345.14)
intellij.prettierJS (222.4345.14)
com.nekofar.milad.intellij.nextjs (1.2.3)
com.intellij.lang.jsgraphql (3.3.0)
com.cursiveclojure.cursive (1.12.5-eap2-2022.2)
Kotlin: 222-1.7.20-release-201-IJ4167.29#2022-11-0214:30EmpperiMight try this also on my home desktop computer if it suffers from this issue or not#2022-11-0307:48cfleming@U7MRZK43B Do you have anything in your log file that might indicate what’s going on? Are you getting error reports in your IDE?#2022-11-0308:04EmpperiNo error messages#2022-11-0308:04EmpperiStuff just doesn't show#2022-11-0308:05cflemingThat is really wierd.#2022-11-0308:06cflemingI’ll look through the code tomorrow morning to see if I can see anything that might cause this.#2022-11-0308:07EmpperiLike this#2022-11-0308:09cflemingAre you using nREPL?#2022-11-0308:09cflemingI guess so, since you mentioned lein.#2022-11-0308:10EmpperiYes#2022-11-0308:12cflemingCould you try this? Go to Help->Diagnostic Tools->Debug Log Settings and add #cursive.testing.actions in the dialog box. Then repro the issue, and hopefully you should see some lines in the log file from cursive.testing.actions.#2022-11-0308:12EmpperiChecking#2022-11-0308:14Empperi2022-11-03 10:13:22,076 [269000779] INFO - #c.i.d.DebugLogManager - Set DEBUG for the following categories: #cursive.testing.actions, cursive.testing.actions
2022-11-03 10:13:28,408 [269007111] FINE - #c.t.actions - {:type :begin-test-ns, :ns "backend.collection-utils-test"}
2022-11-03 10:13:28,409 [269007112] FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-update-map", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 50, :column 1}
2022-11-03 10:13:28,410 [269007113] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 51, :class "backend.collection_utils_test$fn__10106$fn__10107", :method "invoke"} {:file "collection_utils_test.clj", :line 50, :class "backend.collection_utils_test$fn__10106", :method "invoke"}]}
2022-11-03 10:13:28,410 [269007113] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 60, :class "backend.collection_utils_test$fn__10106", :method "invokeStatic"}]}
2022-11-03 10:13:28,410 [269007113] FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-update-map", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 50, :column 1}
2022-11-03 10:13:28,411 [269007114] FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-update-map-vals", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 24, :column 1}
2022-11-03 10:13:28,411 [269007114] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 25, :class "backend.collection_utils_test$fn__10079$fn__10080", :method "invoke"} {:file "collection_utils_test.clj", :line 24, :class "backend.collection_utils_test$fn__10079", :method "invoke"}]}
2022-11-03 10:13:28,412 [269007115] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 33, :class "backend.collection_utils_test$fn__10079", :method "invokeStatic"}]}
2022-11-03 10:13:28,412 [269007115] FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-update-map-vals", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 24, :column 1}
2022-11-03 10:13:28,412 [269007115] FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-cond-fn", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 44, :column 1}
2022-11-03 10:13:28,412 [269007115] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 46, :class "backend.collection_utils_test$fn__10092$fn__10093", :method "invoke"} {:file "collection_utils_test.clj", :line 44, :class "backend.collection_utils_test$fn__10092", :method "invoke"}]}
2022-11-03 10:13:28,413 [269007116] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 47, :class "backend.collection_utils_test$fn__10092$fn__10097", :method "invoke"} {:file "collection_utils_test.clj", :line 44, :class "backend.collection_utils_test$fn__10092", :method "invoke"}]}
2022-11-03 10:13:28,413 [269007116] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 48, :class "backend.collection_utils_test$fn__10092", :method "invokeStatic"}]}
2022-11-03 10:13:28,413 [269007116] FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-cond-fn", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 44, :column 1}
2022-11-03 10:13:28,413 [269007116] FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-update-map-keys", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 7, :column 1}
2022-11-03 10:13:28,413 [269007116] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 8, :class "backend.collection_utils_test$fn__10066$fn__10067", :method "invoke"} {:file "collection_utils_test.clj", :line 7, :class "backend.collection_utils_test$fn__10066", :method "invoke"}]}
2022-11-03 10:13:28,414 [269007117] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 16, :class "backend.collection_utils_test$fn__10066", :method "invokeStatic"}]}
2022-11-03 10:13:28,414 [269007117] FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-update-map-keys", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 7, :column 1}
2022-11-03 10:13:28,414 [269007117] FINE - #c.t.actions - {:type :end-test-ns, :ns "backend.collection-utils-test"}
2022-11-03 10:13:28,414 [269007117] FINE - #c.t.actions - {:type :summary, :pass 9, :fail 0, :error 0, :test 4}#2022-11-0308:15EmpperiOh... And should probably fail the test too 😂#2022-11-0308:15EmpperiOne more time!#2022-11-0308:16Empperi2022-11-03 10:15:42,378 [269141081] FINE - #c.t.actions - {:type :begin-test-ns, :ns "backend.collection-utils-test"}
2022-11-03 10:15:42,378 [269141081] FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-update-map", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 50, :column 1}
2022-11-03 10:15:42,380 [269141083] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 51, :class "backend.collection_utils_test$fn__10232$fn__10233", :method "invoke"} {:file "collection_utils_test.clj", :line 50, :class "backend.collection_utils_test$fn__10232", :method "invoke"}]}
2022-11-03 10:15:42,380 [269141083] FINE - #c.t.actions - {:type :fail, :left "{:FOO \"BAR_lo\", :KIKKA \"KUKKA_lol\"}", :right "{:FOO \"BAR_lol\", :KIKKA \"KUKKA_lol\"}", :trace [{:file "collection_utils_test.clj", :line 60, :class "backend.collection_utils_test$fn__10232", :method "invokeStatic"}]}
2022-11-03 10:15:42,385 [269141088] FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-update-map", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 50, :column 1}
2022-11-03 10:15:42,385 [269141088] FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-update-map-vals", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 24, :column 1}
2022-11-03 10:15:42,385 [269141088] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 25, :class "backend.collection_utils_test$fn__10205$fn__10206", :method "invoke"} {:file "collection_utils_test.clj", :line 24, :class "backend.collection_utils_test$fn__10205", :method "invoke"}]}
2022-11-03 10:15:42,385 [269141088] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 33, :class "backend.collection_utils_test$fn__10205", :method "invokeStatic"}]}
2022-11-03 10:15:42,385 [269141088] FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-update-map-vals", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 24, :column 1}
2022-11-03 10:15:42,385 [269141088] FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-cond-fn", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 44, :column 1}
2022-11-03 10:15:42,385 [269141088] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 46, :class "backend.collection_utils_test$fn__10218$fn__10219", :method "invoke"} {:file "collection_utils_test.clj", :line 44, :class "backend.collection_utils_test$fn__10218", :method "invoke"}]}
2022-11-03 10:15:42,385 [269141088] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 47, :class "backend.collection_utils_test$fn__10218$fn__10223", :method "invoke"} {:file "collection_utils_test.clj", :line 44, :class "backend.collection_utils_test$fn__10218", :method "invoke"}]}
2022-11-03 10:15:42,385 [269141088] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 48, :class "backend.collection_utils_test$fn__10218", :method "invokeStatic"}]}
2022-11-03 10:15:42,386 [269141089] FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-cond-fn", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 44, :column 1}
2022-11-03 10:15:42,386 [269141089] FINE - #c.t.actions - {:type :begin-test-var, :ns "backend.collection-utils-test", :name "test-update-map-keys", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 7, :column 1}
2022-11-03 10:15:42,386 [269141089] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 8, :class "backend.collection_utils_test$fn__10192$fn__10193", :method "invoke"} {:file "collection_utils_test.clj", :line 7, :class "backend.collection_utils_test$fn__10192", :method "invoke"}]}
2022-11-03 10:15:42,386 [269141089] FINE - #c.t.actions - {:type :pass, :trace [{:file "collection_utils_test.clj", :line 16, :class "backend.collection_utils_test$fn__10192", :method "invokeStatic"}]}
2022-11-03 10:15:42,386 [269141089] FINE - #c.t.actions - {:type :end-test-var, :ns "backend.collection-utils-test", :name "test-update-map-keys", :file "C:/Users/niklas.collin/code/nb-id/backend/test/backend/collection_utils_test.clj", :line 7, :column 1}
2022-11-03 10:15:42,386 [269141089] FINE - #c.t.actions - {:type :end-test-ns, :ns "backend.collection-utils-test"}
2022-11-03 10:15:42,386 [269141089] FINE - #c.t.actions - {:type :summary, :pass 8, :fail 1, :error 0, :test 4}#2022-11-0308:16cflemingOk, thanks. That narrows it down for me tomorrow. It looks like the testing events are coming through ok, I’ll see if I can find anything that might stop the UI from showing.#2022-11-0308:16EmpperiGreat, thanks for your help!#2022-11-0308:17EmpperiI can live with this for a while but it is annoying#2022-11-0308:17cflemingNo worries. It’s probably a good idea to remove that line from the log settings, or you’ll get tons of junk in your logs.#2022-11-0308:17cflemingYeah, I can imagine - sorry 😞#2022-11-0308:17EmpperiYup#2022-11-0308:17EmpperiHey, stuff happens#2022-11-0308:17EmpperiOne more thing that might have something to do with this#2022-11-0308:17EmpperiI have Fleet beta installed#2022-11-0308:17EmpperiI can see logging from Fleet in the idea logs#2022-11-0308:18EmpperiIt is a far reaching thing but just an idea#2022-11-0308:18cflemingThat’s…. not expected, at least not by me, but I don’t know much about Fleet. I can’t see how it would interfere though.#2022-11-0308:18EmpperiYeah. It only connects to Idea if it is available for Idea language servers#2022-11-0308:19cflemingAh, ok, that makes sense, it might be the server components for that.#2022-11-0308:19cflemingOk, I’ll look at this tomorrow and report back.#2022-11-0308:19EmpperiI would be extremely surprised if Fleet would be the cause but just one more thing in my env#2022-11-0308:19EmpperiYup. Good night! I think its time there 🙂#2022-11-0308:20EmpperiHere it's 10am#2022-11-0308:20cflemingIt’s definitely getting that way!#2022-11-0407:42cflemingSo I looked at this today, and I can’t immediately see any reason this should happen. I’ll add some more debug logging and get you to try that out, hopefully I should have that tomorrow.#2022-12-2215:35grega100kI recently started seeing this issue where the result of the test is not indicated in the gutter. This thread is 2 months old and I'm not seeing anything more about it. Is there a fix?#2022-12-2215:38EmpperiCan't confirm. I'm between jobs and don't have the laptop anymore. Let's wait for Fleming to jump in from his timezone#2022-11-0218:39jmmkIs there any difference in functionality between running a Local nrepl vs connecting to a Remote nrepl?#2022-11-0308:24cflemingNo, they should be about the same. One slight difference is that uncaught stdout printing will come out in the REPL console for a local REPL, but will go to wherever the REPL server’s output goes in that case.#2022-11-0300:57Ian Fernandezis there any flag that you can detect if clojure is running in IntelliJ in runtime?#2022-11-0301:58salamI wouldn’t expect such a flag to exist. But I would definitely check the IntelliJ IDEA classpath (`System.getProperty("java.class.path")`) for the presence of any Clojure JAR in the https://www.jetbrains.com/help/idea/ide-scripting-console.html.#2022-11-0308:25cflemingWhat’s your use case for this?#2022-11-0314:16Ian FernandezI would like to know if the repl is started in cursive to use portal#2022-11-0314:22Ian Fernandez(def p (p/open {:launcher :intellij}))
#2022-11-0315:23Ian FernandezIf it’s in intellij, add this kv to p/open properties map#2022-11-0321:42cflemingOh, I see - so you want to see if your app is running in a REPL started by Cursive? You could test for the presence of the cursive.repl.runtime ns.#2022-11-0311:08wontheone1I try to run Clojure script REPL with Cursive (with clojure.main) it doesn't find the file (class path).#2022-11-0311:09wontheone1It's deps edn project#2022-11-0311:09wontheone1:cljs {:extra-paths ["src"]
:main-opts [
; "-i" "src/sharetribe/console/ui/figwheel_entry.cljs"
"-m" "sharetribe.console.ui.figwheel-entry" "-b" "dev" "-r"]}
cljs alias is defined like above#2022-11-0311:10wontheone1The error I get is
Execution error (FileNotFoundException) at clojure.main/main (main.java:40).
Could not locate sharetribe/console/ui/figwheel_entry__init.class, sharetribe/console/ui/figwheel_entry.clj or sharetribe/console/ui/figwheel_entry.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
#2022-11-0311:11wontheone1Could someone help me find out the problem? It seems that Cursive REPL does not find files under src directory.#2022-11-0318:06thhellerit looks like you are trying to run a .cljs file? that doesn't work. the REPL is started via Clojure and clojure.main can only run CLJ code#2022-11-0402:12wontheone1Thanks! I finally got it to working by setting up a remote nREPL with piggieback middleware, inspired by a question below!#2022-11-0422:53malMy aliases are prefixed with : so for you :cljs instead of cljs?#2022-11-0707:07wontheone1I don't think I need to put : @UH1MELU4U, I just think Cursive REPL doesn't work with CLJS so I had to use a remote REPL#2022-11-1404:14mal@U354VUKQA I think I got cljs in a Cursive repl…#2022-11-1407:23wontheone1@UH1MELU4U How do I see these options. Mine only shows "which type of REPL to run" and nREPL and clojure.main option.#2022-11-1418:25malI think that’s from a Clojure Application not repl configuration. I think I’m using the repl one however. I just made the repo public if you wan’t to try it https://github.com/xicubed/grok-cljs#2022-11-1507:15wontheone1> mal [8:25 PM]
> I think that’s from a Clojure Application not repl configuration.
I don't know what this means, where can I see the same panel anyways?
Thanks for the repo!#2022-11-2217:22malWhen you add a new run configuration with the + on this screen one of the options is Clojure Application…#2022-11-0311:19mbjarlandso not sure which channel this is most suited to, but I'm trying to start a repl under cursive for a build.clj tools.build build file and can not for the life of me figure out how to get this working. After a restart of intellij I finally got the IDE to load the tools.build dep and can now navigate to the code in tools.build. Trying to load the build.clj (which is in the root of the project next to deps.edn) into the repl results in:
Execution error (FileNotFoundException) at build/eval1926$loading (build.clj:1).
Could not locate clojure/tools/build/api__init.class, clojure/tools/build/api.clj or clojure/tools/build/api.cljc on classpath.
even though I have the build alias defined in the run configuration etc.#2022-11-0403:59cflemingThere are a couple of issues slated for this EAP series which should fix this - for the moment the remote REPL is the best solution.#2022-11-0410:06mbjarlandThank you @U0567Q30W! Are there any tickets I could watch etc?#2022-11-0508:17cflemingYep, https://github.com/cursive-ide/cursive/issues/2653 and the related https://github.com/cursive-ide/cursive/issues/2409, both marked for the current EAP (although it’s taken a while for reasons, so things might get bumped to the next one. But soon.)#2022-11-0311:20mbjarlanddeps.edn
{:paths ["src"] ;; project paths
:deps {org.clojure/clojure {:mvn/version "1.11.1"}
...}
:aliases {:build {:deps {io.github.clojure/tools.build {:git/tag "v0.8.4" :git/sha "8c3cd69"}}
:ns-default build}}}#2022-11-0311:25mbjarlandand in fact when I look at the repl process I can see that the deps from the build alias are not there in the repl classpath (checked by starting a clj -A:build on the command line which does add them). Guess I'm missing something massively obvious here.#2022-11-0311:27mbjarland#2022-11-0311:30mbjarland; build.clj
(ns build
(:require [clojure.tools.build.api :as b])) ; <-- throws the exception above
...
#2022-11-0313:50jmmk@mbjarland I see the same as you when attempting to create a Local REPL using the build alias. If you look at the classpath of the repl process (you can see it by clicking on the line right below Starting nREPL server…) it doesn’t seem to be building it correctly for the build alias, but I’m not sure.
An easy solution is to create a Remote REPL configuration, start the nrepl in your terminal, and connect to it, e.g.
• Create a Run Configuration Clojure REPL -> Remote with Connection type: nREPL and Use port from nREPL file
• Start an nREPL for the build alias (you will need an alias like repl with the nrepl dependency)
◦ clojure -M:build:repl
• Run the Run Configuration for the Remote REPL in IntelliJ and it should connect and you should be able to load in build.clj#2022-11-0313:55mbjarland@jmmk - facepalm thank you! Failed miserably to think about the remote repl option. Yes, there seems to be something off with the alias handling within intellij/cursive.#2022-11-0314:02mbjarlandand that works, thanks again @jmmk#2022-11-0318:00folconThis is a bit strange, is there some reader macro going on to work out how to format this in cursive?
{:count 0, :queue <-, (:add-1-then-2 :add-10-then-20) -<, :stack []}
It seems to think the :queue <-(:add-1-then-2 :add-10-then-20)-<, is two map entries instead of one.#2022-11-0401:24steveb8nQ: how do I configure Cursive to suppress “foo cannot be resolved” warnings in the right gutter for macros correctly required and used in a ns?#2022-11-0401:25steveb8nOh, I think I can resolve-as….#2022-11-0401:28steveb8nso now my question becomes, for Specter navigation macros, what should I resolve-as to remove the warning?#2022-11-0403:58cflemingI don’t think there’s a good way to do that, sorry - I’ve been meaning to look at Specter but surprisingly few people have asked for it.#2022-11-0403:58cflemingI’ll take another look and see if there are some easy wins.#2022-11-0404:56steveb8nThanks. I realise I’ve just been ignoring all the extra colours in the IDE but it’s spring so want to clean 🙂#2022-11-0404:57steveb8nbtw it was easy for the camel-snake-kebab macros. the problem seems to be Specter specific#2022-11-0423:23cflemingYeah, Specter is much more complicated than csk#2022-11-1013:28onetomi only had to set the resolve as for a few def* specter macros and most of the symbols are resolved#2022-11-1107:33steveb8n@U086D6TBN thanks. I tried this and got “select” resolved. still struggling with navigators e.g. ALL. which macro did you resolve to fix the uppercase nav macros?#2022-11-0417:07kendall.buchananI’ve confirmed this works in Calva, I wondered if there was a way to navigate to symbols found in EDN files. For example:#2022-11-0417:07kendall.buchanan["/resources"
["/:resource"
{:summary "Show an individual resource page"
:name :banzai.pendant.front.routes/resource
...
:view banzai.pendant.front.resource.page/View}]]]#2022-11-0521:27cflemingWhat would you want to navigate there? The banzai.pendant.front.resource.page/View bit?#2022-11-0616:06kendall.buchananYes, that’s correct.#2022-11-0616:06kendall.buchananIt’s a function var. #2022-11-0702:15onetomDatomic Cloud has an ion-config.edn file, which also has a bunch of fully-qualified symbols and I was also hoping I could just jump to their definitions from there 🙂
https://docs.datomic.com/cloud/ions/ions-reference.html#ion-config
It pains me to say, but since I hardly ever need this, I think this should be a low-priority issue.
For example I suffer more from unnecessary reloads caused by Cmd-Shift-M, which can completely hose a live environment.
My workaround for such navigation issue, is:
1. jump to the beginning or the end (`Ctrl-A/E`) of the fully-qualified symbol
2. select it with Extend selection (`2x Opt-Up`)
3. then Go to symbol... (`Cmd-Opt-O`)#2022-11-0715:01kendall.buchanan@U086D6TBN Somehow I’d never noticed you could highlight something and open the search bar with the item pre-filled. Great, thank you.#2022-11-0417:07kendall.buchananThat’s sample data from a Reitit config sitting in EDN.#2022-11-0714:44GGfpcIs it possible to use structural editing to convert nested inline code to a threaded form? It only seems to work one s-expression at a time and that's not very useful so maybe I'm missing how it's supposed to work#2022-11-0714:44GGfpcWhen I select the whole form it says it needs to be in a list to work#2022-11-0714:58imrehow I use the feature is that I put the caret to the innermost form (i.e. what I want to be the first arg in the thread) and then repeatedly execute "thread form" until the threading macro is where I want it to be#2022-11-0719:17onetomexactly!
think of it as picking up the end of the thread and start pulling it.#2022-11-0811:05sbIs that possible add custom buttons for REPL tool bar? like at Navigation Toolbar?#2022-11-1003:29cflemingIt looks like that is not configurable at the moment. Could you add an issue for that and I’ll fix it, please?#2022-11-1007:11sbOk! Im going to add as “issue”. Thank you very much!! #2022-11-0811:06sbI added the “Repl Commands” there.#2022-11-0818:49hadilsHi! I am using malli/experimental with Cursive. The mx/defn is almost identical syntacically to Prismatic schema. I got the function definition to resolve, but not the arg list, which has type specifiers like this: (mx/defn function :- RetType [arg1 :- ArgType] …) Is there a way to resolve the arg list in Cursive? I am using IntelliJ IDEA 2022.2.3 (Ultimate Edition).#2022-11-0913:52tony.kayUsing latest stable Cursive. I have a project (not all projects do it) where if I try to load any CLJC file into a CLJ repl I get:#2022-11-0921:36cflemingHi Tony, go to Help | Diagnostic Tools | Debug Log Settings… and add #cursive.namespace to the popup window. Then reproduce, and you should get an equivalent message in the logs with more info.#2022-11-1013:30onetomim having a similar issue with tick.core -> tick.file -> tick.core (on tick/tick {:mvn/version "0.5.0"})
will try to see if i can repro it too. it's intermittent...#2022-11-1013:48tony.kayOK, I just invalidated caches and restarted…I’ll do that now…#2022-11-1013:50tony.kayAh, that’s way more helpful:
2022-11-10 08:50:16,699 [ 212790] DEBUG - #cursive.namespace - Dependency cycle /Users/tonykay/.m2/repository/com/taoensso/tufte/2.3.0/tufte-2.3.0.jar!/taoensso/tufte/impl.cljc -> /Users/tonykay/.m2/repository/com/taoensso/tufte/2.3.0/tufte-2.3.0.jar!/taoensso/tufte/impl_new.cljc -> /Users/tonykay/.m2/repository/com/taoensso/tufte/2.3.0/tufte-2.3.0.jar!/taoensso/tufte/impl.cljc
Looks like I have two versions of tufte on the classpath#2022-11-1013:51tony.kaybut I know how to figure it out now, thanks!#2022-11-1014:47tony.kay@U0567Q30W general feedback. I know you’re trying to keep the UI clean, but that popup needs to show full ns names. I know it is messy, but the popup was completely useless to me because I didn’t know which of my MANY deps was the problem I just knew it wasn’t my code.#2022-11-1014:48tony.kaywhich created drag for me, a question to answer for you, and serious drag for several of my team members yesterday that could have probably been avoided if the full ns would have just been in the error that was user-visible.#2022-11-1014:49tony.kayand now I have to figure out where to document how to do the special logging for future reference in case it happens again, and then I have to remember where I documented it (and the fact that I did document it) when it does happen again (which it will…this isn’t the first time in 4 years)#2022-11-1014:50tony.kaywhich means it will eventually cause another crappy day…#2022-11-1023:45cflemingOk, how about if the log continues to show full file info (which is useful for finding which dep contains them etc), and the popup contains full ns names?#2022-11-1023:47cflemingOh, actually, I’ll have to look at that code again. There are actually two layers of checks here, one for namespaces which have cycles, and one for files which have cycles. I’ll look at that again, but even in the file case it could show the file path back to the local root (like taoensso/tufte/impl.cljc in this case).#2022-11-1023:50cflemingI’ll also look at that case to see if I can figure out why it’s occurring.#2022-11-1100:23tony.kayYeah, anything that lets you pinpoint it to the dependency would be invaluable#2022-12-0206:53onetomI tried to set this debug log option, but even after restarting intellij, im not getting any logs about the dependency cycle, although i can reliable trigger it at the moment.
I did see, that the log option change has been registered though:
2022-12-02 14:47:43,976 [9550328] INFO - #c.i.d.DebugLogManager - Set DEBUG for the following categories: #cursive.namespace, cursive.namespace
#2022-12-0206:58onetomtried it in both 2022.2.4 & 2022.3#2022-11-0913:53tony.kaybut there is no such file in my source anywhere (impl), nor can I find such a file in the dependencis.#2022-11-0913:53tony.kayideas?#2022-11-1100:38onetomIs it just me, or others are getting these exceptions on startup in
IntelliJ IDEA 2022.3 Beta (Ultimate Edition)
Build #IU-223.7571.4, built on November 9, 2022
?
1. Cursive (1.12.5-eap-2-2022.3) java.lang.Throwable: Activities registered via registerPostStartupActivity must be dumb-aware: cursive.build.BuildSystemUtil$$Lambda$1473/
2. IDEA core java.lang.IllegalStateException: java.lang.IllegalStateException: No HighlightingSession found for ClojureFile (class cursive.repl.ReplFragment) in ProgressIndicator 670549150: running=true; canceled=false in map: ClojureFile (class cursive.psi.impl.ClojureFileImpl) -> HighlightingSessionImpl: myVisibleRange:(2697,5816); myPsiFile: ClojureFile; ClojureFile (class cursive.psi.impl.ClojureFileImpl) -> HighlightingSessionImpl: myVisibleRange:(0,2813); myPsiFile: ClojureFile
#2022-11-1108:08cflemingIt’s not just you - I have the first one fixed for the next build. I haven’t seen the second though, but I’ll check it out tomorrow.#2022-11-1402:06cflemingThe first one is fixed in the current EAP, out now. However I haven’t seen the second one, and no-one else has reported it through the tracker as far as I can see. Is that when you’re debugging? I can’t see how you’d receive it at startup.#2022-11-1402:06cflemingDo you have a full stacktrace from the logs for that one?#2022-11-1100:54onetomOn 2022.2.2 I'm having issues with cursor focus being lost, especially, when pair programming over the native client of http://pop.com
On 2022.2.3 Load File in REPL (`Cmd-Shift-L`) is loading unnecessary files into remote nREPLs
On 2022.3.x I'm getting the mentioned exceptions constantly, which is very distracting, but we found other small issues too, as expected from EAP versions
I'm feeling like when I have a small rock get stuck in my shoe and i can't get it out 🙂
It feels like IntelliJ is constantly getting faster and smoother, so I would really like to be on the latest version.
I found the new UI pretty good too, after some tweaking, so that has a strong draw too 🙂#2022-11-1101:07onetomah, yeah, i can completely lose symbol resolution in 2022.3.x, within minutes after opening a project, despite it being fine initially#2022-11-1101:08onetomso it's not really usable at the moment 😞#2022-11-1101:03onetomI must be fatiguing to build a Clojure plugin on top of this hyper-object-oriented JetBrains editor platform 🙂
I just peeked into java.net.HttpCookie recently and I was baffled to see, that it's still relying on System.currentTimeMillis() for it's constructor and hasExpired() method and even some expiryDate2DeltaSeconds() private method, used from some assignors java.util.Map...
My head is spinning from it and I'm still not sure, how could I mock the time in it.
If it would be using java.time.Clock, I could just use a different one...#2022-11-1101:05onetomI mean, even the JDK is so convoluted, so I can imagine that the JetBrains API being even crazier.#2022-11-1413:46Ivar RefsdalI was able to (in practice) override System.currentTimeMillis using javassist/bytecode rewriting.
Test verification:
https://github.com/ivarref/hookd/blob/main/agentuser/test/agentuser/core_test.clj#L53
I've seen a few test libraries and byte-buddy do this as well...
Welp. I spent way too much time on this 😕#2022-11-1603:01onetomoh, that's reassuring, if clojure libs are doing such wizardry too!#2022-11-1603:04onetomfor java.time use-cases i gave a try to the tick.core/with-clock macro (from https://github.com/juxt/tick) and it works reasonably well, just needs some practice and getting familiar with the various clock options...#2022-11-1603:08onetomi see you were also testing with java.net.HttpCookie 🙂
so much time is wasted on this issue world-wide probably.
either because ppl can't believe it's not supported to fake time
or they actually write tests, which use wall-clock time, constantly slowing down test feedback loops...#2022-11-1113:13Felipe Nascimentohey guys, Can cursive auto complete node depedence?#2022-11-1119:54cflemingNo, sadly - I’m considering some options for that.#2022-11-1113:14Felipe Nascimento#2022-11-1201:58Sam AdamsSeems like cursive has trouble identifying call sites of functions whose names include "-$"? (Although autocomplete works, and the call site links me to the function definition just fine). I can file an issue if it would be helpful.#2022-11-1201:59cflemingYes, please!#2022-11-1202:19Sam Adamshttps://github.com/cursive-ide/cursive/issues/2746#2022-11-1313:39Dustin GetzI found this cool cursive repl hook : https://www.reddit.com/r/Clojure/comments/lzx0zb/did_you_know_that_ideacursive_repl_results_may_be/. Is there a intellij API that we can call to put that contents into the clipboard?#2022-11-1313:44Dustin Getzhttps://plugins.jetbrains.com/docs/intellij/working-with-text.html#safely-replacing-selected-text-in-the-document seems pretty close#2022-11-1313:52Dustin Getzhttps://github.com/JetBrains/intellij-community/blob/4bec5270ac967904d8a874eb5d12749e8e3510a2/platform/platform-impl/src/com/intellij/openapi/editor/actions/CopyAction.java#L111#2022-11-1313:53Dustin Getzhttps://github.com/JetBrains/intellij-community/blob/0e2aa4030ee763c9b0c828f0b5119f4cdcc66f35/platform/editor-ui-api/src/com/intellij/openapi/ide/CopyPasteManager.java#2022-11-1313:55Dustin Getzpublic abstract void setContents(@NotNull Transferable content);
Transferrable content = ...;
CopyPasteManager.getInstance().setContents(content);#2022-11-1313:55Dustin Getzhttps://github.com/JetBrains/intellij-community/search?q=setContents#2022-11-1313:56Dustin GetzCopyPasteManager.getInstance().setContents(new StringSelection("hello world"));#2022-11-1314:04Dustin GetzSo the real q is: how do i "cross the streams" and run some code in the cursive process?#2022-11-1320:39cflemingSomething like this? https://clojurians.slack.com/archives/C0744GXCJ/p1644978986077219#2022-11-1320:48Dustin Getz(let [s (java.util.UUID/randomUUID)]
(.setContents (.getSystemClipboard (java.awt.Toolkit/getDefaultToolkit))
(java.awt.datatransfer.StringSelection (str s))
nil))
yeah looks great#2022-11-1320:50cflemingI’m planning to update the REPL commands to have options to do this more automatically, but that’s a nice workaround in the meantime.#2022-11-1402:00cfleminghttps://twitter.com/CursiveIDE/status/1591973561316491264#2022-11-1403:27onetomi have on more issues on starting
IntelliJ 2022.3 Beta Build #IU-223.7571.4, built on November 9, 2022
i still get this exception though, when i start a local nREPL:
java.lang.IllegalStateException: java.lang.IllegalStateException: No HighlightingSession found for ClojureFile (class cursive.repl.ReplFragment) in ProgressIndicator 1762953232: running=true; canceled=false in map: ClojureFile (class cursive.psi.impl.ClojureFileImpl) -> HighlightingSessionImpl: myVisibleRange:(0,3380); myPsiFile: ClojureFile
#2022-11-1403:34onetomthe funny thing is, that im getting this error even a JS-only project...#2022-11-1407:50cfleming> i have on more issues on starting
Was that: I have one more issue, or: I have no more issues?#2022-11-1416:31onetomoops, sorry, i meant
NO more issues - as in exceptions in the Notifications tool window - on startup.
that No HighlightingSession found for ClojureFile exception appears when im starting the REPL.
in the meantime, i did find an issue though, after startup has settled, scanned all the files for indexing and whatever it does about the dependencies afterwards and i have no symbol resolution for my src & test deps.edn :paths, BUT i have for the dev directory...
same project doesn't have this issue under 2022.2.{2,3} of course.
i tried to run Refresh Clojure Deps Projects manually, but that didn't fix it.
i've deleted my compiled classes/* - which is also on my classpath - no difference either.
i tried to use tools.deps version 0.15.1244 directly and also clojure cli 1.11.1.1189; makes no difference either.#2022-11-1423:12cflemingThat’s really weird. Are those folders marked as sources in the project view?#2022-11-1602:23onetomyes, they are correctly marked as both source and test roots.
the strange thing is that the src dir has a library root annotation next to it in the Project tool window, but those are the sources, which can't resolve even clojure.core.
while the dev & test paths don't have this library root indication, yet they have no issue with the symbol resolution.
dev & test are also added via :extra-paths in 2 different tools.deps aliases.#2022-11-1602:25onetomah, i found something strange!
there is no Deps tool window!
despite having IntelliJ sub-modules, with a Clojure configuration tabs.
i can email a screenshot.#2022-11-1602:27onetomnvm, the Deps tool window was just hidden from the Tool Window Bars#2022-11-1406:19onetomi've accidentally opened the Profiler tool window, where I saw a clojure.main Process.
when I left-clicked on it, I got a menu with an Attach IntelliJ Profiler item.
after clicking that, it has started to collect profiling info, which i could explore on a flame-graph, after stopping the profiling.
it captures way more info, that what i would usually want, but at least it's built-in to intellij 🙂
the flame-graph navigation was very choppy though (in IntelliJ IDEA 2022.2.3; i think they improved on it recently)#2022-11-1613:21souenzzonot exactly a cursive question
but while using the Terminal from intellij, many tools, like kondo report things in /home/file.clj:<line_no>:<column_no>: <message> format
Is possible to have a "goto reference" behavior by clicking on this terminal output?#2022-11-1706:08cflemingI’m not sure about this sorry, I haven’t seen anything like this but it may be possible.#2022-11-2209:39Jordan RobinsonJust a quick note to say I just found this setting and having worked with a multi-module setup with ~100 filenames being the same if they're truncated, I'm so glad this is an option, changing it to full namespace from the default immediately improved my day, thanks Colin!#2022-11-2211:06seriogaFor me the “File name” option works better than namespaces.#2022-11-2218:45dvingoI'm on 1.12.5-eap3-2022.2 and still not able to load namespaces in a Clojure REPL that use :as-alias because of the "dependency cycle" erroneous message. IntelliJ IDEA 2022.2.3 (Ultimate Edition)
I see in the changelog this is supposed to work
https://github.com/cursive-ide/cursive/blob/master/CHANGELOG.md#2022-11-2420:50cfleming@U051V5LLP Is that for Clojure or CLJS?#2022-11-2514:06dvingoIt is happening for both - it is a .cljc file where the problem is happening#2022-11-2514:07dvingoone .cljc file is using :as-alias of another .cljc file#2022-11-2404:30Ian Fernandez#2022-11-2404:30Ian Fernandezhow can I proceed on running a project that has figwheel-sidecar error like this by "Run with IntelliJ Classpath" ???#2022-11-2404:52onetom1. u can downgrade clojure to 1.10.x
2. u can transition to https://figwheel.org/.
while figwheel-sidecar doesn't explicitly states it, but in practice, u can consider it deprecated, as the A new Figwheel!! heading hints at it, at the top of its README:
https://github.com/bhauman/lein-figwheel
here are more thoughts on the topic:
https://clojureverse.org/t/what-is-the-difference-between-figwheel-main-and-figwheel-sidecar/6832/5#2022-11-2407:04wontheone1Have you tried to use remote REPL?#2022-11-2509:11onetomnot sure I understand the question,
but i haven't worked with ClojureScript or figwheel-main running in a browser for many years.
but i do connect to remote nREPLs often (running within Datomic Cloud ion servers). why?#2022-11-2509:30wontheone1That was a suggestion for Ian 🙂#2022-11-2408:50Ian FernandezHow can I force IntelliJ to run with clojure 1.10.1 for example??#2022-11-2410:00wontheone1Isn’t the version specified in deps.edn or project.clj ?#2022-11-2413:39Ian Fernandezyes, it is but the IntelliJ classpath is enforcing clojure 1.11.1#2022-11-2413:43imreDo you by any chance have an alias/profile ticked in tge relevant tool window which pulls in 1.11.1¿#2022-11-2413:44imreHave you done refresh deps/lein project and the restarting the repl?#2022-11-2413:46Ian FernandezI'm using a maven project :')#2022-11-2413:46Ian FernandezDo you by any chance have an alias/profile ticked in tge relevant tool window which pulls in 1.11.1¿
No, inspected the tree#2022-11-2413:47imreOh I see. Maven+clojure is unknown territory to me I'm afraid#2022-11-2413:48Ian FernandezI've inspected the maven dependency tree with mvn dependency:tree -Dverbose=true and nothing pulls clojure 1.11.1#2022-11-2413:49imreAnd does anything specifically pull the desired version?#2022-11-2413:51Ian FernandezSyntax error macroexpanding clojure.core.async/go
Attempting to call unbound fn: #'clojure.tools.analyzer.utils/update-vals#2022-11-2413:51Ian FernandezAnd does anything specifically pull the desired version? Yes, I'm pulling in clojure 1.10.1#2022-11-2414:29imrewhat version of clojure tools.analyzer is being pulled in and by what?#2022-11-2414:36Ian FernandezI'm pulling out tools.analyzer 1.1.0#2022-11-2414:55imreand what version of core async?#2022-11-2413:39Ian Fernandezyes, it is but the IntelliJ classpath is enforcing clojure 1.11.1#2022-11-2415:55Shantanu KumarHi. Probably a Noob question - how do I re-indent a line (or selection) correctly after I mistakenly moved it?#2022-11-2416:31wontheone1cmd alt L works for me in my mac#2022-11-2512:38Shantanu Kumar@U354VUKQA Thanks, I got it working with Ctrl+Alt+L on Linux. Selecting text and the key combination applies re-indentation to just the selected text.#2022-11-2420:11ericdalloIn case anyone with Intellij plugin knowledge knows how to help :)#2022-11-2510:07devurandomHello!
Is it possible to make Cursive always run tests via the REPL (cf. https://cursive-ide.com/userguide/testing.html) when I click the green arrow next to deftest or the green double arrow next to ns ,,,-test?
I know I can go via the "Tools" menu, but I got quite accustomed to clicking the green arrows. Firing up a whole test runner for my current project takes quite some time, so I would like to know a convenient way to run tests via the REPL in a similar manner.#2022-11-2510:54cflemingThere isn’t at the moment, no, but I get that people would like that option. I’ll think about ways to achieve that.#2022-11-2601:46kennytiltonWhat I did was bind the run and re-run commands to ^Q and shift-^Q. Iteration heaven. I can even use ^Q when I have navigated to different source file and made a change. I almost never take the trouble to customize key bindings, but here I saw a bigggg win.#2022-11-2515:57octahedrionis there any way to suppress warnings output to the REPL from Clojure or Java code over which one hasn't got control ?#2022-11-2516:02respatializedif it's Java code that uses java.util.logging, I've used the following in the past to suppress messages:
(import '[java.util.logging Logger])
(.setLevel (Logger/getLogger "org.javacode.mylib.MyClass") java.util.logging.Level/SEVERE)
But this requires you to know the name of the class triggering the warnings, which isn't always obvious or easy to discover if it's somewhere down in your dependencies.#2022-11-2516:03octahedrionsadly it's not#2022-11-2810:07octahedrionit's actually coming from C code fprintfing to stderr#2022-11-2810:07octahedrion(via JNA)#2022-11-2610:42onetom@cfleming I just tried IntelliJ 2022.3 RC2 Build #IU-223.7571.123, built on November 23, 2022
and im getting a new kind of error, which i haven't seen before.
i hope this helps pinning down the issues with symbol resolution:
In file: file:///Users/onetom/.../api_repl.clj
java.lang.IllegalStateException: Attempting to call unbound fn: #'cursive.annotator/create-visitor
at clojure.lang.Var$Unbound.throwArity(Var.java:45)
at clojure.lang.AFn.invoke(AFn.java:32)
at clojure.lang.Var.invoke(Var.java:384)
at cursive.api.DelayedFn.invoke(DelayedFn.java:31)
at cursive.annotator.ClojureAnnotator.createVisitor(Annotator.kt:25)
at cursive.annotator.ClojureAnnotator.annotate(Annotator.kt:20)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.runAnnotators(DefaultHighlightVisitor.java:131)
at com.intellij.codeInsight.daemon.impl.DefaultHighlightVisitor.visit(DefaultHighlightVisitor.java:108)
at com.intellij.codeInsight.daemon.impl.GeneralHighlightingPass.runVisitors(GeneralHighlightingPass.java:344)
...
(this one i was able to submit to you successfully, via the intellij error reporter)#2022-11-2701:37onetomyes, it has always happened for those 3-4 times i tried.
but since i have no symbol resolution everywhere, i can't really use this version combination to see if there are any more errors.#2022-11-2804:24Lusia@cfleming Manage to see this stub generation issue in IntelliJ IDEA 2022.2.4 (Ultimate Edition) Build #IU-222.4459.24, built on November 22, 2022 (on @onetom’s team), which we haven't seen before:
java.io.FileNotFoundException: /Users/lusia/Library/Caches/JetBrains/IntelliJIdea2022.2/cursive_stubs_3176d153/342a3e14-tmp/73746538.clj (No such file or directory)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
at java.base/java.io.FileOutputStream. (FileOutputStream.java:235)
at $fn__11619.invokeStatic(io.clj:230)
at $fn__11619.invoke(io.clj:230)
at $fn__11543$G__11525__11550.invoke(io.clj:69)
at $fn__11631.invokeStatic(io.clj:263)
at $fn__11631.invoke(io.clj:259)
at $fn__11543$G__11525__11550.invoke(io.clj:69)
at $fn__11593.invokeStatic(io.clj:166)
at $fn__11593.invoke(io.clj:166)
at $fn__11556$G__11521__11563.invoke(io.clj:69)
at $writer.invokeStatic(io.clj:119)
at $writer.doInvoke(io.clj:104)
at clojure.lang.RestFn.invoke(RestFn.java:410)
at clojure.lang.AFn.applyToHelper(AFn.java:154)
at clojure.lang.RestFn.applyTo(RestFn.java:132)
at clojure.core$apply.invokeStatic(core.clj:669)
at clojure.core$spit.invokeStatic(core.clj:7021)
at clojure.core$spit.doInvoke(core.clj:7021)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at user$eval253.invokeStatic(create-stub5683523002239954284.clj:2)
at user$eval253.invoke(create-stub5683523002239954284.clj:2)
at clojure.lang.Compiler.eval(Compiler.java:7194)
at clojure.lang.Compiler.load(Compiler.java:7653)
at clojure.lang.Compiler.loadFile(Compiler.java:7591)
at clojure.main$load_script.invokeStatic(main.clj:475)
at clojure.main$init_opt.invokeStatic(main.clj:477)
at clojure.main$init_opt.invoke(main.clj:477)
at clojure.main$initialize.invokeStatic(main.clj:508)
at clojure.main$null_opt.invokeStatic(main.clj:542)
at clojure.main$null_opt.invoke(main.clj:539)
at clojure.main$main.invokeStatic(main.clj:664)
at clojure.main$main.doInvoke(main.clj:616)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.lang.Var.applyTo(Var.java:705)
at clojure.main.main(main.java:40)
#2022-11-2808:05cflemingCould you check which of those files exist? Does the file cursive_stubs_3176d153/342a3e14-tmp/73746538.clj exist? What about the cursive_stubs_3176d153/342a3e14-tmp or the cursive_stubs_3176d153 directories? Using the full path from the error message, of course.#2022-11-2809:33Lusiasubfolder 342a3e14-tmp doesn't exist
ls /Users/lusia/Library/Caches/JetBrains/IntelliJIdea2022.2/cursive_stubs_3176d153
7d8a2494 83c6d90e
#2022-12-0105:24onetomthis has just happened to me again too, during stub generation on IJ Build #IU-223.7571.182, built on November 29, 2022 & Cursive 1.12.5-2022.3:
java.io.FileNotFoundException: /Users/onetom/Library/Caches/JetBrains/IntelliJIdea2022.3/cursive_stubs_1c381054/82249e8f-tmp/62a3afe9.clj (No such file or directory)
at java.base/java.io.FileOutputStream.open0(Native Method)
<same stack trace as above; i've spot-checked most line number and they matched>
checked the file hierarchy:
❯ cat /Users/onetom/Library/Caches/JetBrains/IntelliJIdea2022.3/cursive_stubs_1c381054/82249e8f-tmp/62a3afe9.clj
cat: /Users/onetom/Library/Caches/JetBrains/IntelliJIdea2022.3/cursive_stubs_1c381054/82249e8f-tmp/62a3afe9.clj: No such file or directory
❯ ls /Users/onetom/Library/Caches/JetBrains/IntelliJIdea2022.3/cursive_stubs_1c381054/82249e8f-tmp/
ls: cannot access '/Users/onetom/Library/Caches/JetBrains/IntelliJIdea2022.3/cursive_stubs_1c381054/82249e8f-tmp/': No such file or directory
❯ ls /Users/onetom/Library/Caches/JetBrains/IntelliJIdea2022.3/cursive_stubs_1c381054/
27a67855 82249e8f a66d1e33
#2022-12-0105:25onetomnoticed this, after i did a cache invalidation, because i still don't have symbol resolution everywhere in this project#2022-12-0105:30onetomi've disabled
;com.clojure-goes-fast/clj-async-profiler
;{:mvn/version "1.0.0"}
so i have no errors or warning during opening this project, no errors in the project structure dialog either and no errors in the run configurations, but still no symbol resolution, even for clojure.core.#2022-11-3009:43Thomas MoermanQ about the test-runner in Cursive: in my current setup a failing test is reported with expected and actual value reversed in comparison to clojure.test and kaocha output. Could this be a bug or is it a configuration?#2022-11-3013:03onetomCan you share screenshot of some trivial repro case, like (is (= 3 (+ 1 2))?#2022-11-3013:05Thomas Moerman#2022-11-3013:09Thomas Moermankaocha output:#2022-11-3013:14onetomindeed, im seeing the exact same results.
also, for the record, loading this file:
(ns cursive.test-runner-test
(:require [clojure.test :refer :all]))
(deftest expected-actual-order-test
(is (= 2 (+ 3 3))))
(run-test expected-actual-order-test)
results in this REPL output:
Loading test/cursive/test_runner_test.clj...
Testing cursive.test-runner-test
FAIL in (expected-actual-order-test) (test_runner_test.clj:5)
expected: (= 2 (+ 3 3))
actual: (not (= 2 6))
Ran 1 tests containing 1 assertions.
1 failures, 0 errors.
Loaded
#2022-11-3013:20onetomtried it from the command line too, without any kaocha or matcher combinators being present on the classpath and the result is the same:
❯ time clojure -Srepro -Sdeps '{:paths ["test"]}' -M -e "(require 'cursive.test-runner-test)"
Testing cursive.test-runner-test
FAIL in (expected-actual-order-test) (test_runner_test.clj:5)
expected: (= 2 (+ 3 3))
actual: (not (= 2 6))
Ran 1 tests containing 1 assertions.
1 failures, 0 errors.
clojure -Srepro -Sdeps '{:paths ["test"]}' -M -e 0.98s user 0.08s system 80% cpu 1.326 total
so, i agree, it seems, that the built-in cursive reporter explanation is backwards.#2022-11-3021:13cflemingThe thing is that there’s no defined order - kaocha might have a convention, but (is (= x y)) just checks that two things are equal, with no concept of which is expected and which has been calculated. However, that message in the test runner doesn’t come from Cursive so it must be coming from either the IntelliJ test runner or clojure.test - I’ll check. It’s possible I’m swapping the first and second values somewhere.#2022-12-0106:23onetomI was also thinking about where did the convention of the ordering come from.
I think the most authorative suggestion is the docstring of the is macro:
(defmacro is
"Generic assertion macro. 'form' is any predicate test.
'msg' is an optional message to attach to the assertion.
Example: (is (= 4 (+ 2 2)) "Two plus two should be 4")
...
which is also in-line with tests of Clojure itself, eg:
https://github.com/clojure/clojure/blob/828d82fb5bae9a985f32279b819e22ae436022da/test/clojure/test_clojure/string.clj
though u can see an order reversal here:
https://github.com/clojure/clojure/blob/7b102d84c60ed88d62989d6fd4a6994bd33b3bec/test/clojure/test_clojure/parse.clj#L10-L14
but still, it's been made explicit, that the 1st argument of the predicate within is is the expected one.#2022-12-0111:35Thomas MoermanThank you @U0567Q30W and @U086D6TBN for looking into this gratitude . That said, it's not a critical issue so don't feel pressed.#2022-12-0500:35onetomBTW, there is a package for kaocha, which flips the order of actual and expected:
https://github.com/magnars/kaocha-noyoda
it's mentioned here:
https://github.com/lambdaisland/kaocha/blob/main/README.md?plain=1#L261-L262#2022-12-0502:51cflemingRight, I definitely think the order of expected/actual is pretty loosely defined here. I’d have to check, but I’m pretty sure the Cursive diff view uses “Left” and “Right” instead of “Expected” and “Actual”. But I’ll have to figure out where that message is actually coming from first.#2022-12-0100:23cfleminghttps://twitter.com/CursiveIDE/status/1598110203349585920#2022-12-0618:17Mr. Savyi just switched to intellij’s new ui and lost all my cursive/repl stuff. is cursive supported in the new ui or should i downgrade for now?#2022-12-0618:19Mr. Savythe new cursive release says support, so i assume it should still work.#2022-12-0618:39kennytiltonSorry, what exactly do you mean by "lost all my cursive/repl stuff"? Is the plugin still installed?#2022-12-0618:45kennytiltonFWIW, I just now upgraded to Community 2021.2.4 and all is well.#2022-12-0618:49Mr. Savynone of the buttons are there, and i can’t seem to manually run the repl by selecting the project.clj file.#2022-12-0618:51R.A. PorterI believe you’ve talked past each other. @U012MJU8XNU you mean the experimental New UI that can be switched to in version 2022.3, correct?#2022-12-0618:51R.A. PorterI haven’t tried switching to it (and now am afraid to do so) yet.#2022-12-0619:22Sam AdamsI’ve been using the new UI pretty successfully with a deps project, REPL etc. Sometimes the deps, repl icons don’t show up in the right side gutter, but i can access that functionality via e.g. double-shift “search everywhere” #2022-12-0619:44Mr. Savy@U01GXCWSRMW correct. i also tried what @U016C0EGHUN suggested but i didn’t get any prompts to show up. will try again though to be doubly sure.#2022-12-0619:44Mr. Savy*by prompts i mean any cursive repl commands#2022-12-0619:58Mr. Savyyeah no dice#2022-12-0623:03cflemingI haven’t tried the new UI, but I know a few people (e.g. @U086D6TBN) are using it.#2022-12-0712:41imreI've been using the new UI since I got into the preview round and haven't noticed problems. Mind you I mostly drive IJ via keyboard shortcuts and IJ's action search#2022-12-0715:05onetomi only used the new UI with a deps project.
i had to enable the deps tool window first with the ... menu on the top-left toolbar.
can't remember why did I do that though.
afterwards i was able to start both local and remote nREPL run configurations.
I'm often getting a IDEA core error about syntax highlighting, but that doesn't seem to affect functionality in any perceivable way.
I did switch back to the default UI though, because I think it's atrocious, how I can't shrink the left gutter to something minimal.
1. it wastes my screen estate
2. it's worse UX than before, because my code just hangs in the air and I can't tell how much is it indented. it's it in a Rich-content or not?
3. the gutter is the same color as the editor area, which makes things even worse#2022-12-0715:10R.A. PorterI've turned it on, because I might as well start getting used to it now before they kill the old UI. I did, however, just switch from their "preferred" font, Inter, to Jetbrains mono. Who the HELL wants a proportional font when editing code? That, and not all the ligatures worked with Inter. Terrible font.#2022-12-0715:10onetomhere is a comparison.
look at the bottom right area.#2022-12-0715:14onetom@U01GXCWSRMW i would love to use a proportional font.
i did use proportional fonts, until i started working with clojure.
before that, i was indenting code with tab, so even with proportional fonts, the indentations at the beginning of lines corresponded to the nesting level.
with clojure though, the indentation varies based on the form, so we had to indent with spaces and every editor invariable renders leading spaces very narrowly, as if they were in-between words.
if only they would render them em width, then the indentations would stay consistent (more or less) with the level of nesting they represent.#2022-12-0715:15kennytiltonCrazy thought. We do not get the Tools/REPL menu item until we start a configuration. I never noticed that so I lost a couple hours once when I happened not to have started a config and was struggling to find the Tools/REPL.#2022-12-0715:15onetomwith proportional fonts u can fit 10-20% more characters within the same horizontal space and they look even more pleasing and more legible too.#2022-12-0715:17R.A. PorterIf the editor were intelligent enough to understand alignment with a proportional, then I'd agree. That would require quite a bit, though.#2022-12-0715:17onetom@U0PUGPSFR yes, u don't get a Tools / REPL menu, until u start a REPL#2022-12-0715:58onetom@U01GXCWSRMW as a little comparison of the same clojure/changes.md & clojure.{datafy,core} content between monospaced Comic Code Ligatures & the proportional Lato fonts.
aside from the broken indentation, I would much rather use the Lato font...
i think what the algorithm should be is to render leading spaces in a way that they end up under the same characters as they would, when the previous line were rendered as a monospaced font.
i tried to implement this logic actually, when VS Code came up, but their class hierarchy was just an unpenetrable jungle to me... 😞
im not sure which editor could i use to test this idea on...
probably Emacs would be the most approachable, though at this low level, it's probably just as messy as other editors.
or maybe https://github.com/fredoverflow/freditor / https://github.com/fredoverflow/clopad ?#2022-12-0715:59R.A. PorterI agree that it looks better in general, but alignment is a must-have for me for Clojure, indentation from the margin being a subset of alignment.#2022-12-0802:21salamAh, the New UI… 😆 I’ve been using it since I got accepted to the internal preview program and haven’t had any problem related to Cursive. As mentioned above, overly large paddings in UI components were one of the things I didn’t like about it. But this doesn’t bother me that much since, like most of us, I drive the IDE using keyboard shortcuts and thus configured the IDE to hide most of the UI components including editor tabs (except the status bar, which is where the Navigation Bar and VCS widgets currently are.) The other thing that felt stuck out like a sore thumb to me was the so-called Main Toolbar (the one that’s at the top of the main IDE window that has the VCS, and Run Configuration widgets in it) but I was delighted when I found out you can now completely get rid of it in the latest version of IntelliJ IDEA (2022.3).#2022-12-0802:55salamYeah, that left gutter in the New UI screenshot does look slightly wider than what I have. #2022-12-0802:57cflemingI’m curious, for those using the new UI - why did you switch? What do you think?#2022-12-0803:01salamI was, well, curious when it was announced... 😄 I gave it a try, didn't see much of a difference (since I'm a heavy keyboard shortcut user and hide most of the UI stuff) and never bothered to switch back to the soon-legacy UI...#2022-12-0803:06R.A. PorterI switched but because I know I'll have to eventually. I figured I'd rip off the band-aid.#2022-12-0803:07cflemingI’m not sure it’s a given that the old UI is going away, or did I miss something?#2022-12-0803:08R.A. PorterOne of their stated reasons to do it is to modernize their codebase. In that case, I can't imagine they'd want to maintain that quantity of old code alongside the new.#2022-12-0803:11salamform one of their blogs:
> The current UI will remain available for at least two years, and we’re not going to remove it until we’ve seen that the vast majority of our users have successfully made the switch to the new UI.#2022-12-0803:12R.A. PorterSounds about right.#2022-12-0803:13salamand we all know "vast majority of" us are https://blog.codinghorror.com/the-magpie-developer/ 😄#2022-12-0803:13cflemingOk, thanks. I think I’ll wait a while for the feedback to percolate before ripping the band-aid off. I should put some effort into making sure that Cursive works ok with it though.#2022-12-0803:13cflemingHa, the older I get, the more I like boring. I customise my IDE to the absolute minimum.#2022-12-0803:14salamsame here. I actually followed your IDE customization guide and Hadi Hariri's suggestions (hiding tabs, etc.) 😛#2022-12-0803:15R.A. PorterYeah. My IJ key mappings are the ones they had back in their first release. If I felt confident the legacy UI would never go away, I would not have shifted.#2022-12-0803:16salamI don't think keyboard shortcuts (at least, those for pure actions) will change depending on which UI we are using... at least, I haven't noticed.#2022-12-0803:17R.A. PorterThey seem the same so far.#2022-12-0803:17salamyeah#2022-12-0803:18salamby the way, Colin, have you thought about "modernizing" the source file icons? the current Clojure file icons look too bright in otherwise dark UI...#2022-12-0803:19salamI really like the source file icons in Clojure Kit, they seem to blend in well with both the light and dark themes:
https://github.com/gregsh/Clojure-Kit/tree/master/resources/icons#2022-12-0803:20cflemingI have thought about it, but haven’t got around to it. I’ll check clojure-kit’s ones, thanks for the tip.#2022-12-0803:21cflemingI guess now I have to test my icons not only in light and dark themes, but also old-ui and new-ui 😛#2022-12-0806:30eskosIn fairness, Clojure-Kit’s icons are probably drawn/edited by same people as the entire IDEA iconset, since Clojure-Kit is made by a JetBrains employee 🙂#2022-12-1315:26imre> Main Toolbar (the one that’s at the top of the main IDE window that has the VCS, and Run Configuration widgets in it) but I was delighted when I found out you can now completely get rid of it in the latest version of IntelliJ IDEA (2022.3).
@UDCGPTV9R could you please share how to get rid of it?#2022-12-1317:32salamSure. There are two ways to do it:
- directly on the UI: right click on the widgets and remove everything under the Main Toolbar Left or Main Toolbar Right tree nodes
- under IntelliJ IDEA’s Settings / Appearance & Behavior / Menus and Toolbars / Main Toolbar Left and Main Toolbar Right, remove everything under those two tree nodes. This is also where you can reset them to their original states.
#2022-12-0711:33Ernesto GarciaIf you exactly type a previously used ns alias plus a var defined in that ns (like pprint/pprint, Cursive will suggest "Require namespace".
It would be useful to just offer autocompletion+require for known ns aliases, without the need of typing the exact ns alias + var combination. Or is this available already somehow?#2022-12-0715:58markbastianNote quite a Cursive question, but IntelliJ/Mac/Cursive. I got a new Mac running Ventura synced my shortcuts from the cloud and the raise shortcut doesn't work. Should be cmd+'. Anyone else have this issue and know what the solution is? I'm wondering if there's some reserved global shortcut or something.#2022-12-0716:01onetomyes, i've experienced that too before, but i can't remember what was the solution.
in fact, i vaguely remember, that restarting intellij fixed the issue for awhile, until it occurred again.
which version combination are you using?
im also using Karabiner Elements, so i thought it could be related to that, but it think it wasn't.#2022-12-0722:19cflemingYou can check to see if there’s a conflict in IntelliJ at Preferences | Keymap, using Find Actions by Shortcut (this icon here:)#2022-12-0722:20cflemingThat will show you if there are any conflicts in IntelliJ that might be a problem. Note that there will be some other actions there since actions are context sensitive, but hopefully you’ll be able to tell if they’re ones that might conflict in the context of an editor.#2022-12-0722:21cflemingThe other thing to check is OS shortcuts, under System Preferences | Keyboard. I don’t think there’s a good way to search there, though. I seem to recall using a Mac tool to debug a similar problem once, but I can’t remember what it was.#2022-12-0717:54kanweiI've got an issue where there's a huge amount of memory being generated which causes everything to be slow:#2022-12-0717:54kanwei#2022-12-0723:45astrasheThis is a small thing, but is anyone else having trouble downloading ClojureDocs? It's timing out for me.#2022-12-0809:04Jordan Robinsonmine also seems to be timing out this morning#2022-12-0910:24Ivar RefsdalSame problem here.
I reported it here: https://github.com/zk/clojuredocs/issues/245#issuecomment-1344123111#2022-12-0911:48Lauri LehmijokiSame problem here as well.#2022-12-1400:52cflemingThis apparently was a disk issue, and should be fixed now.#2022-12-1400:54astrasheIt's working for me. Thanks!#2022-12-0811:10henryw374hello. is there an easy way to open deps.edn files from up the hierarchy? ie the one in ~/.clojure#2022-12-0911:13conanHi, I'm running intellij/cursive in wslg, and can't download clojuredocs. I can hit the URL via wget in a terminal; any ideas why this is happening?#2022-12-0911:18Ivar RefsdalThere is a thread about this here: https://clojurians.slack.com/archives/C0744GXCJ/p1670456748195419#2022-12-0912:27henryw374hi again . just checking, there's still no way to configure your own test runner to use when doing 'run tests in ns'..?#2022-12-0913:08Jakub Holý (HolyJak)Any chance that https://github.com/cursive-ide/cursive/issues/1945 will be addressed eventually? I is soon going to celebrate its 5th birthday… Of course I understand there is a LOT to do (I see there is 1.2*k* issues 😰 ) but I just again run into this and wasted couple of hours due to not seeing a test assertion failed…#2022-12-0923:23cflemingYes, this is scheduled for the next release (it was scheduled for the last one, but 2022.3 put paid to that).#2022-12-1214:00Jakub Holý (HolyJak)awesome! :star-struck:#2022-12-1016:20UlisesMACHi all,
Is there a way to automatically align case, cond or cond-> pairs like the pairs inside the let's vector?
Thanks!#2022-12-1108:52gravAn alternative approach is to use line breaks between pairs:
(case x
1
"hello"
2
"goodbye")
#2022-12-1110:14eskosThat IMO looks ugly, but eh, formatting is always a matter of taste... 🙂
You can tell Cursive to (re)format specific symbols as something else, see https://cursive-ide.com/userguide/formatting.html
Basically, you can tell Cursive to format case/cond/cond-> as let and it'll work the same.#2022-12-1113:58UlisesMAC@U052XLL3A yep, when the expression is too big I usually style using what you suggested, but it's not very common.
@U8SFC8HLP Have you found an expression to assign to style cond and case?
Since let aligns the pairs inside the first argument (a vector), and case's first parameter is a var, I'd like to style the rest arguments that aren't inside a vector and I haven't found an expression that performs that alignment.#2022-12-1121:03cflemingNo, there isn’t a good way to do this at the moment, sorry.#2022-12-1121:23UlisesMACOk, thanks!#2022-12-1217:41serioga@U02TF2JU3M4 I use commas to align#2022-12-1406:28seriogaYes, like this https://github.com/strojure/parsesso/blob/df52f4058bc164991fdd9d67bda7244ee4e40fbb/src/strojure/parsesso/impl/error.cljc#L16-L28#2022-12-1604:27staypufdNice trick since comma’s are considered whitespace. 🙂#2022-12-1216:33Miķelis VindavsIt seems like lately Cursive is having trouble again finding usages across deps
E.g. we have a main app and it has a local dependency :deps {blah/shared {:local/root "../shared"}}
When trying to find usages of a function in shared, it only finds call sites that are also in shared but not in the whole project.
This used to be severely broken ~6months ago, then worked just fine, and now seems to be broken again.
Is there any workaround for this that we could try?
Also, many multimethod implementations are not picked up by find usages, even if they are in the same file. I can’t make out a pattern either, it seems random#2022-12-1304:11onetomi think, i've experienced these exact issues too, but i just fall back to namespace search, symbol search of plain text search in such cases.#2022-12-1308:26cflemingI have a change in the works (prompted by https://github.com/cursive-ide/cursive/issues/2554, but it’s a general deps fix which will help with that issue, not specifically for Polylith) which I’m hoping will fix this.#2022-12-1317:24Miķelis VindavsThanks for replying, looking forward to it!#2022-12-1400:12cfleminghttps://twitter.com/CursiveIDE/status/1602818627232681984#2022-12-1421:02cfleminghttps://twitter.com/CursiveIDE/status/1603132925431930880#2022-12-1521:25Sam AdamsIntelliJ question -- as of ~weeks ago, when I command-` between IntelliJ windows, it often bounces back to the original window -- it's super annoying -- is anyone else having this issue?
Edit: apparently so: https://youtrack.jetbrains.com/issue/IDEA-225577/JetBrains-apps-trap-cmd-commandbacktick-and-dont-respect-it-as-a-system-shortcut#2022-12-1521:31Sam AdamsAnd to close the loop: fixed for me by unbinding IntelilliJ's Activate Next Window keymap#2022-12-1913:25helios@cfleming did you ever get around to implement the support for matcher combinators? https://github.com/nubank/matcher-combinators/issues/31#issuecomment-1165997443#2022-12-1920:08cflemingI actually have this half done in a branch, and it’s still slated for the next release.#2022-12-1916:18markaddlemanMy workflow includes frequently printing a SQL string to the REPL and then copying the string to the clipboard so I can paste it into a db tool. I’d like to automate copying the string to the clipboard. Is there some intellij scripting magic for this?#2022-12-1917:12imregoogling for clojure string clipboard gave me https://gist.github.com/brake/c944229350e91f295a1762d3274393ef#2022-12-1917:13markaddlemanYour google fu is more powerful than mine 🙂#2022-12-1917:13markaddlemanThanks!#2022-12-1917:13imreI think it would probably be easier to go straight to the clipboard from clojure than get intellij involved#2022-12-1917:13markaddlemanI had assumed that intellij had to be involved but your solution is better#2022-12-1917:14imreputting to the clipboard is just another side effect, like printing to out is#2022-12-1917:14markaddlemanmakes sense#2022-12-2010:15simongrayUpdating to the latest intellij nuked all my settings and destroyed my custom theme… welp…
Almost back where I was before, but I can’t figure out how to prevent intellij from needlessly abbreviating my namespaces in e.g. Recent Files.
Anyone here know how to disable this one-character namespace abbreviation stuff?#2022-12-2010:16Jordan Robinsonthis I think: https://clojurians.slack.com/archives/C0744GXCJ/p1669109986233719#2022-12-2010:19simongrayThank you!#2022-12-2100:56d5pwith the new feature in 1.12.5 that inserts requires from completions etc, it breaks our formatting if the insert makes it the first require entry like the following:
(ns converter.coerce
(:require [clojure.string :as str]
[clojure.tools.logging :as log]))
if I insert say a clj-time requirement from a completion, it formats it as:
(ns converter.coerce
(:require
[clj-time.core :as t]
[clojure.string :as str]
[clojure.tools.logging :as log]))
instead of retaining our existing formatting (which is fine when it inserts it in other positions)#2022-12-2109:36cflemingLooks like a bug, yes - could you file an issue please, and I’ll get that fixed for the next build.#2022-12-2100:56d5pi can't see a way to customise this , bug?#2022-12-2112:19Miķelis VindavsWhen searching for usages of a symbol, the line items only show the file name. There doesn’t seem to be anyway to include the full path or the full namespace. The “File structure” toggle doesn’t change anything either.
If there are multiple files with the same name it’s impossible to tell them apart.
I think this is a regression#2022-12-2112:21Miķelis VindavsIt would be nice if it added just enough information to disambiguate between files in the result set.
But even always showing the full NS / file path would be ok.
Currently the only workaround is opening the full find tool window#2022-12-2112:22Miķelis VindavsAnd in the full find tool window, a similar problem exists - the file structure setting is ignored, the only way to tell them apart is by enabling group by package which adds a lot of noise#2022-12-2112:22Miķelis Vindavsis there any way to customize this that I’m missing?#2022-12-2112:24Miķelis Vindavsalso note that even enabling the preview (cut off in my screenshot above) only shows the file name, not the path or anything else#2022-12-2112:24Miķelis Vindavsby comparison, the find in files dialog always shows the full path of each file#2022-12-2121:47cflemingI looked into this a while ago. Unfortunately this is an IntelliJ dialog that I can’t customise, and I don’t think there’s any way to achieve this. I’ll ask again in the plugin support slack.#2022-12-2219:13imreIf this bothers you, go and upvote https://youtrack.jetbrains.com/issue/IDEA-195508 - I did#2022-12-2219:13imreIf this bothers you, go and upvote https://youtrack.jetbrains.com/issue/IDEA-195508 - I did#2022-12-2312:47SudipI have a deps project. When I run it from cli clj -A:alias1:alias2, and do require '... the relevant ns, it works fine. However, when I try to do the same on Intellij, by setting the aliases in run configuration, it errors with Execution error (ClassNotFoundException) at jdk.internal.loader.BuiltinClassLoader/loadClass (BuiltinClassLoader.java:641). ..a classapath...
What might be going wrong? I don't explicitly provide any path in the cli.#2022-12-2402:25cfleminghttps://twitter.com/CursiveIDE/status/1606475848462503936#2022-12-2917:09Jakub Holý (HolyJak)Is it recommended to upgrade from IntelliJ 2022.3 to 2022.3.1? Do you know? I have latest stable Cursive.#2022-12-2917:21markaddlemanfwiw, I’m using the latest IntelliJ with no problems. I have switched to the (experimental?) UI and I really like it#2022-12-2917:21Jakub Holý (HolyJak)thanks!#2023-01-0202:33kennytiltonHunh. I let IntelliJ upgrade to 2022.3.1. It seems to want to waste a line to tell me I wrote every function. Anyone know how to make those (apparently git blame) annotations go away?#2023-01-0203:05R.A. PorterThis might help: https://www.jetbrains.com/help/idea/investigate-changes.html#show-author-of-changes#2023-01-0203:10kennytiltonThx, @U01GXCWSRMW! I just found this insanity, too:
We’ve implemented Code Vision inlay hints for JavaScript and TypeScript. These hints provide you with instant insights about your code right in the editor, displaying metrics like inheritors, usages, code authors, and related problems. The hints are interactive. For example, you can click on the usages hint to see all usages of the class or method in the project.
The metrics are all enabled by default now and can be modified in Settings/Preferences | Editor | Inlay Hints | Code vision.
"enabled by default"? sigh
So I disabled the whole Code Vision suite, clicked "apply", and nothing happened. When I saved it finally took effect. Yay.
Now I just have to figure out whether a .cljc file is JS or TypeScript. :rolling_on_the_floor_laughing:#2023-01-0317:18genekim@cfleming and all — thanks for making Cursive, and making the REPL experience so easy. Posting this here only for amusement.
At the request of the author, I recently added some docs to https://github.com/lilactown/7-humble-guis on how to get the REPL running on Cursive, because there was only documentation on cider.
The top box is what I wrote (two bullet points), versus the documentation on getting cider running. I thought the contrast was pretty dramatic. 🙂#2023-01-0321:06kennytiltonFYI Since somewhat absent-mindedly upgrading to 2022.3.1 I have run into the dread yellow highlighting symbols not recognized on two projects, both ClojureDart, and worked around it by recreating the IntelliJ projects from scratch. Hth!#2023-01-0505:56seriogaClear cache should work in such cases#2023-01-0511:50kennytilton@U0HJNJWJH Sorry, I should have mentioned that I tried clearing cache in each case before turning to the more Draconian solution of creating a whole new .idea project. Only the latter worked.#2023-01-0505:56seriogaClear cache should work in such cases#2023-01-0507:51gravIs there a way to not show the whole stack on AssertFailed?#2023-01-0507:51gravI remember Alex Miller mentioning on the ClojureStream podcast that it wasn't the default behaviour#2023-01-0509:21cflemingUnder which circumstances? Where do you want it to be truncated?#2023-01-0509:24gravIn this case I ran a fn that invoked clojure.walk/prewalk, and the java.lang.AssertionError happened at a place where the stack was quite large. So in the repl, it was difficult to see where what was going on.#2023-01-0509:25cflemingOk, do you have a link to the discussion mentioning different behaviour for that exception? I don’t think Cursive does anything along those lines right now but I’m open to adding it. It sounds like it’s possible that might be something you could control at the Clojure level too, possibly?#2023-01-0509:26gravYeah, might be. I might have misunderstood Alex' comment though 🙂
I'll try digging it up, one mo#2023-01-0509:27cflemingThanks. I’m putting my daughter to bed shortly, but drop it here if you find it and I’ll take a look when I get a chance.#2023-01-0509:35gravGood luck 😉
Here's the episode:
https://podcasts.apple.com/us/podcast/e86-2022-in-review-datomic-and-clojure-with-jaret/id1461500416?i=1000590958632&itsct=podcast_box_player&%3Bitscg=30200&%3Bls=1&%3Btheme=auto
The part where he speaks about tools is around 34:40.#2023-01-0509:37gravAt 35:45 he mentions the the Clojure Repl never automatically prints stack-traces, so that was my reference#2023-01-0514:35folconFor some reason cursive isn't resolving functions / vars that have been imported using an import macro, this is in a library, so code changing would be a bit of a pain, is there anything that can be done to improve resolution so stuff like autocomplete works?
I'm hoping there's some special resolution that I can use which tells cursive to treat the vars differently? Resolve as declare is ok, but it would be good if I could see things like args and docstrings.#2023-01-0514:39folconThis is the macro:
https://github.com/HumbleUI/HumbleUI/blob/main/src/io/github/humbleui/core.clj#L409
This is where the vars are being imported that cursive can't see:
https://github.com/HumbleUI/HumbleUI/blob/main/src/io/github/humbleui/ui.clj#L42#2023-01-0517:03folconAlso it would be super helpful if there was a place where I could lookup if custom resolves are defined in cursive. I've just realised that in a project I've gotten a resolve working, but it's not clear what symbol I used to make it work.#2023-01-0900:59cflemingYou can see the resolves at: Preferences | Languages & Frameworks | Clojure | Symbol Resolution#2023-01-0900:59cflemingI’ll take a look at that import macro and see if it might be possible to resolve it as a built-in option.#2023-01-1013:32folconThanks a bunch @U0567Q30W 😃...#2023-01-0517:03folconAlso it would be super helpful if there was a place where I could lookup if custom resolves are defined in cursive. I've just realised that in a project I've gotten a resolve working, but it's not clear what symbol I used to make it work.#2023-01-0519:30sjharmsIs there a way to make Cursive work with nbb? It looks like some dependencies can be put in an unused deps.edn , any other suggestions?#2023-01-0900:58cflemingThere are some open issues to fix around this, slated for fixes soon: https://github.com/cursive-ide/cursive/issues/2749, https://github.com/cursive-ide/cursive/issues/2696#2023-01-1114:38wilkerlucioalso stumbled in this: https://clojurians.slack.com/archives/C029PTWD3HR/p1673447742868659#2023-01-0522:22souenzzoI'm using :resource-paths ["target/cljsbuild"]
lein classpath shows target/cljsbuild
but cursive REPL, using "intellij classpath", do not have target/cljsbuild in the (System/getProperty "java.class.path")
• why
• how can I see which classpath cursive is using?
#2023-01-0901:00cflemingThe classpath is available as part of the executed Java command line, which is folded at the top of each REPL when it’s run.#2023-01-0901:01cflemingI’m not sure why that would not be working though, I’ll look into that.#2023-01-0600:50cfleminghttps://twitter.com/CursiveIDE/status/1611163112492904450#2023-01-0613:06polymerisYay, new lein versions 🥳 Thanks, @U0567Q30W#2023-01-0701:10cflemingNo worries, sorry that one took so long!#2023-01-0908:54Al Z. HeymerWhen I use defmethod with a named fn (i.e. (defmethod multi-name dispatch-val fn-name ...) , the fn-name is shown as unresolved by cursive. I see that defmethod does not specify to name a dispatch fn , which is quite annoying by itself, but is there any chance that this could be fixed in cursive? I surely could open a ticket for this. Otherwise, is it possible to suppress this very specific resolve error?#2023-01-1011:45Al Z. HeymerApparently this was already roadmapped for 1.12 https://github.com/cursive-ide/cursive/issues/899#2023-01-1106:22heliosPrevious thread: https://clojurians.slack.com/archives/C0744GXCJ/p1655298871487369#2023-01-1003:09markbastianI have an interesting issue and I'm not sure if it's Cursive or Clojure. I have this protocol:
(defprotocol IOutbox
(outbox-write! [this event])
(outbox-read [this])
(outbox-get [this event])
(outbox-delete! [this event]))
The implementation looks like this#2023-01-1005:40cflemingThat issue is Cursive mistaking that line for an invocation. Which version of Cursive are you running?#2023-01-1005:41cflemingAlso, what is the form there, is it a deftype, defrecord, or something else with similar syntax?#2023-01-1005:43cflemingThis should have been fixed in 1.12.5: https://github.com/cursive-ide/cursive/issues/2346#2023-01-1005:55markbastian1.12.7-eap1-2022.3#2023-01-1005:57markbastianIn the code above, I have the following setup:
1. The IOutbox protocol is defined in one ns.
2. In the displayed ns there is a record: (defrecord RefChat [db outbox])
3. The above snippet is in a extend-type RefChat form and is one of the extended types. #2023-01-1007:55seriogaDoes this implementation work? I've never seen implementing function names with namespaces...#2023-01-1013:15imreYeah I think you are only supposed to use the namespace part with the protocol itself#2023-01-1013:15imreplanex-api/IOutbox
(outbox-write! ...
#2023-01-1014:33markbastianIt does work. TIL....#2023-01-1014:33markbastianThanks!#2023-01-1014:33markbastianAnd yes, removing the ns part fixes everything.#2023-01-1014:33imreI recall running into this every now and then#2023-01-1003:10markbastianNotice the red line. It says "Incorrect arity 2 for" that method. Any idea what's up with that?#2023-01-1106:21heliosAny advice in how to teach cursive about how to resolve this macro?
(deflambda :a/keyword
{option-map}
[args]
body)#2023-01-1107:08seriogaLooks like defn#2023-01-1108:54heliosresolving it like a defn doesn't help unfortunately 😞#2023-01-1108:55seriogawhat library is that?#2023-01-1108:55helioscustom macro, no library#2023-01-1108:55helios(defmacro deflambda
[dispatch-val metadata fn-binding & fn-body]
`(let [metadata# (assoc ~metadata :handler ~dispatch-val)]
(. ~(with-meta 'ductile.lambda/handle {:tag 'clojure.lang.MultiFn})
addMethod
~dispatch-val
(with-meta
(fn [req#] (enter-chain req# metadata# (fn [#2023-01-1109:00serioga> resolving it like a defn doesn't help unfortunately
well, it does not work because :foo/bar is keyword not symbol...#2023-01-1109:00heliosyep#2023-01-1109:04seriogaSeems only solution is to resolve as None to suppress Cursive warning.#2023-01-1116:31Joe R. SmithWhy not just accept a symbol? It can still be ns-qualified (nd since it's a macro, you can do whatever w/ it in the macro body)#2023-01-1116:32Joe R. SmithI do that for some of my macros- cursive doesn't care if the symbol has a namespace, e.g.:#2023-01-1118:15Sam AdamsIs there currently any way to get Run test under carat in REPL working with a defspec test? I see this issue was closed: https://github.com/cursive-ide/cursive/issues/632. Resolving as deftest doesn't seem to work#2023-01-1210:37simongrayHow can I make Cursive indent Rum macros properly?#2023-01-1210:58imreI would set them to 'indent only' https://cursive-ide.com/userguide/formatting.html#code-style-settings#2023-01-1210:41gregI noticed that if I require clojure.core with :refer lots of symbols is highlighted. Possibly a bug. Have a look at the screenshots.
I'm using Idea 2022.3.1 (IU-223.8214.52) & Cursive 1.12.7-2022.3.#2023-01-1309:13cflemingLooks like a bug, yeah - could you file an issue for that, please?#2023-01-1309:44imreOOC why do you require clojure.core?#2023-01-1309:45imreas opposed to using (:refer-clojure ...)#2023-01-1404:12cflemingYes, probably a better question I should have asked would be: what are you trying to achieve with that? Since clojure.core symbols are usually all referred anyway.#2023-01-1410:44gregTbh possibly I added it by mistake, what I realised when @U08BJGV6E pointed it out, still, acting like the previous refer (in this case the implicit refer of clojure.core) is cancelled, therefore highlighting all symbols from the first one, doesn't reflect how clojure namespace works.
Another example:
(ns dev-client.test
(:require
[clojure.set :refer [union]]
[clojure.set :refer [intersection]]))
(union #{:a :b} #{:a})
(intersection #{:a :b} #{:a})
Despite an error of duplicated require it is working example, but Cursive highlights the symbols required in the first refer line.#2023-01-1410:48gregIf something should be highlighted or suggested (eg. via IntelliJ inspections) is "redundant refer" or "duplicated refer".#2023-01-1411:03greg> Looks like a bug, yeah - could you file an issue for that, please?
I opened the issue here:
https://github.com/cursive-ide/cursive/issues/2761#2023-01-1307:44steveb8nQ: I want to start using Cursive on a laptop (Intel OSX) to connect to a REPL running on a M1 Mac Mini on the same network. The connection part should be simple but I’m trying to figure out which file-system hosts the source files. Any tips for this setup?#2023-01-1307:46steveb8nMy thinking is that I can expose the project from the M1 filesystem as a network drive and open that project on the laptop. That way the REPL server and the IDE are both loading the same source files. Is this the best way to do this or is there a better way?#2023-01-1307:46steveb8nIn other words, I’m looking for “this is the way” for a remote REPL dev workflow#2023-01-1414:25gregTbh I haven't done anything like that but in theory the minimal setup is that the code has to be available at least to the REPL client while the REPL server can start with literally nothing and load anything you want after start from client (incl. libs via clojure.tools.deps.alpha.repl).
Although hosting sources with REPL server has advantages that you can load whatever you need at the process start. Therefore the setup you describe, with same network and sharing sources to client via network drive sounds nice.#2023-01-1707:43steveb8nThanks. Yes I think it's at least the right direction#2023-01-1623:20markbastianIs there a way to export or at least view the cursive formatting rules (e.g. to use with cljfmt)?#2023-01-1623:30markbastianActually, looks like it’s spelled out fairly plainly in Editor -> Code Style -> Clojure -> Form Parameters. What I’m really looking for is how to translate the UI dialog into something I can also use with external formatting tools like cljfmt. Like “Export to cljfmt.edn.”#2023-01-1709:38cflemingUnfortunately the cljfmt model doesn’t map very well onto how Cursive formats things. I’m planning to try to improve this, and improve the interop between the two, but there isn’t a good way to do this except manually right now.#2023-01-1713:18jdmthat's good to know. Would love to see this come to fruition#2023-01-1715:08markbastianIs one of the standard formatting tools (zprint, cljfmt (sounds like not), cljstyle) used under the hood or is it custom? Just curious. If I were trying to configure a pre-commit hook it would be nice to at least start with the same baseline formatter.#2023-01-1720:06cflemingIt’s custom, because it has to be built on the IntelliJ formatter. However, it’s very old code now and I’m planning to re-work it and try to make it more compatible with cljfmt.#2023-01-1716:31markbastianHow might I configure Cursive to format require blocks to align on the colon instead of two spaces. Example:
(:require
[clojure.tools.logging :as log]
instead of
(:require
[clojure.tools.logging :as log]
?#2023-01-1716:40markbastianI think “One space list indent” did it.#2023-01-1819:45markbastianIs there a location in IJ Settings where we can see our “Resolve as…” selections?#2023-01-1820:08cflemingYes, Preferences | Languages & Frameworks | Clojure | Symbol Resolution#2023-01-2010:22Rachel Westmacottis there a way to make the output of REPL commands replace the current selection?#2023-01-2010:23Rachel WestmacottI'm currently hacking it by putting data on the clipboard and then using a java.awt.Robot to Crtl+V .#2023-01-2014:12caleb.macdonaldblackWould love this feature too. #2023-01-2020:11cflemingI’m planning to add this.#2023-02-0902:06cflemingI’ve just released an EAP build which allows this: https://clojurians.slack.com/archives/C0744GXCJ/p1675908328557129#2023-02-0909:20Rachel WestmacottThis looks amazing. Thank you so much! gratitude#2023-01-2015:51Ernesto GarciaHi, this seems like an issue: When requiring [chime.core :as chime] , chime/chime is being highlighted by Cursive as deprecated, due to its deprecation in the bare chime namespace. But it's not deprecated in chime.core.#2023-01-2020:09cflemingThat does look like a bug, I’ll check that.#2023-01-2016:29markbastianIs there an option to align the logic in cond statements, like:
(cond
:a "this"
:bbbbb "that"
:c "the other")
vs
(cond
:a "this"
:bbbbb "that"
:c "the other")
?#2023-01-2020:10cflemingNo, there isn’t at the moment but I’m planning to add this.#2023-01-2416:41JurkoHi, can someone help me with Clojure Deps in Cursive. How to change "config dir"?
{:version "1.11.1.1113"
:config-files ["/usr/local/Cellar/#2023-01-2416:43Alex Miller (Clojure team)the config dir is determined from the following info (the "user" deps.edn): https://clojure.org/reference/deps_and_cli#deps_sources#2023-01-2416:43Alex Miller (Clojure team)I suspect you have $XDG_CONFIG_HOME set#2023-01-2416:44Jurkoyes#2023-01-2416:44Alex Miller (Clojure team)so you can override by setting CLJ_CONFIG#2023-01-2416:45JurkoI saw this, but haven't understand#2023-01-2416:47JurkoIs it problem of Cursive or Clojure?#2023-01-2416:48Alex Miller (Clojure team)that's an environment variable, so you'll want to export a new setting wherever you do things like that, in such a way that Cursive sees the effects of that#2023-01-2416:49Alex Miller (Clojure team)Cursive can either use the clojure CLI or use an embedded library (tools.deps). In both cases, those use the described environment variables#2023-01-2416:49Jurkoas I understand clojure know what is "config-dir". Why Cursive can't see it?#2023-01-2416:50Alex Miller (Clojure team)I don't understand, sorry#2023-01-2416:50Alex Miller (Clojure team)from the original post, you said you wanted to change the config dir - you do that by setting environment variables#2023-01-2416:51JurkoResult of clojure -Sdescribe is
:config-dir "/Users/jurko/.config/clojure"
#2023-01-2416:51Alex Miller (Clojure team)what problem are you seeing?#2023-01-2416:52Jurkobut for Cursive config dir is /Users/jurko/.clojure#2023-01-2416:53Alex Miller (Clojure team)ok, I would guess that at the terminal, you have $XDG_CONFIG_HOME set, but that Cursive is not seeing that environment variable due to how it is configured or started#2023-01-2416:53Alex Miller (Clojure team)you can check that by doing something like (System/getenv "XDG_CONFIG_HOME") at a repl in Cursive#2023-01-2416:55Alex Miller (Clojure team)so then the question is how to set environment variables in a way that Cursive sees them - I don't know the answer to that, but it probably depends on how you start it#2023-01-2417:04JurkoThank you.#2023-01-2417:50JurkoFollowing @U064X3EF3 suggestion, I've check at local and remote repl:#2023-01-2417:51Alex Miller (Clojure team)well in the remote case, you're checking the environment of the remote jvm, so not sure that's relevant#2023-01-2417:51JurkoRemote does see variable, local - doesn't#2023-01-2418:26dvingoyou can set env vars in the run config#2023-01-2500:04cflemingIn Cursive, you can use Preferences | Build, Execution, Deployment | Build Tools | Clojure Deps | Project Settings | Path to config directory#2023-01-2518:20dimaHello 👋 defn and some other functions from clojure.core are not resolved. I tried solutions from https://cursive-ide.com/userguide/troubleshooting.html#help-lots-of-symbols-don-t-resolve but nothing has helped.
def for example is resolved, i can see docstring when i hover it. But still cannot cmd+click to navigate to definition.#2023-01-2612:18dimaAlso, local binding from let are not resolved, i.e. i cannot cmd+click on them to navigate#2023-01-2710:01dima"cannot find declaration to go to" when i click on local variables. I believe it was working before. I'm on IDEA 2022.3 and Cursive 1.12.7-2022.3#2023-01-2710:22dimaIt works well with IDEA 2022.2. I would suggest not to upgrade to IDEA 2023.x for anyones who having similar issue.#2023-01-2719:55cflemingYes, Cursive does not support 2023.1 yet, I’m working on that, should be out soon.#2023-01-2710:22dimaIt works well with IDEA 2022.2. I would suggest not to upgrade to IDEA 2023.x for anyones who having similar issue.#2023-01-2610:28gravA collegeue of mine cannot see the diff for failing tests. The orange dot is simply not shown next to the code. What can the issue be?#2023-01-2708:42grav@U0567Q30W any hints for this issue? 🙂#2023-01-2715:40grega100kThere was a pretty long thread on November 2, 2022 that sounds like the same issue#2023-01-2718:47gravThanks @U2FQAF90R, seems this is the thread:
https://clojurians.slack.com/archives/C0744GXCJ/p1667397700150869
Haven't had time to look it through yet with my colleque#2023-01-2719:54cflemingYes, I was going to add some debug logging, but Empperi then wasn’t working on that project any more. I’ll check whether I got around to adding it, and perhaps @U052XLL3A’s co-worker could test it out.#2023-01-2721:02gravSure, I'll ask him to try it out 👍#2023-01-2722:50cflemingI’ll check how it works and let you know.#2023-02-0114:57grega100kI am also seeing this issue so could also help test this.#2023-01-2617:26roklenarcicsometimes when using Add import autofix in my code the namespace declaration structure is updated by Cursive:
(ns user
(:require [ :as io]
[clojure.string :as string]
[clojure.pprint :refer (pprint)]
[clojure.repl :as repl]
[clojure.test :as test]
to
(ns user
(:require
[clj-http.client :as http]
[ :as io]
[clojure.string :as string]
I’d rather it didn’t do that. How?
Also I see there’s support for single space ident, but does that correctly handle if macros and such… it seems not…#2023-01-2621:08cflemingThat’s https://github.com/cursive-ide/cursive/issues/2763, which is fixed for the next build.#2023-01-2621:08cflemingI think the single space indent should handle if forms.#2023-01-2708:11roklenarcicin my testing it works like this:
(if a
b
c)
but if you break before first argument it does single space for the condition and 2 for clauses:
(if
a
b
c)
also something like or does single space where I would expect 2:
(or
a
b)
This is mostly an issue where other members of the team use the typical single space solution where things have single space ident and some macros have 2 space ident, and I keep breaking this formatting. Also for import, I’d prefer that the existing formatting wasn’t changed when imports are added.#2023-01-2708:12cflemingI’ll look at the if problem, thanks.#2023-01-2708:12cflemingWhat are the problems you’re seeing with imports?#2023-01-2708:14roklenarcicin our files we have a mix of different require statement formats:
(:require [....
also
(:require
[.....
also
(:require
[.....
I just don’t like it when it reformats the thing (and introduces many lines of git changes)#2023-01-2711:03onetom@helios are you using the cursive test runner?
how quick can u run a single unit test?
for us, even a simple unit test takes 4+ seconds to run, because so many things are initialized.
Eg. pretty-printing Datomic Cloud datoms is initialized in a xxx.test-harness namespace, which we require in every test NS, for the sake of simplicity and consistent testing experience.#2023-01-2711:05onetomand that's on an M1 Mac Mini, with the biggest libraries clojure.core/compiled...#2023-01-2711:07onetom(time (require 'xxx.test-harness))
"Elapsed time: 3801.725792 msecs"
and without compiled libs:
(time (require 'xxx.test-harness))
"Elapsed time: 6548.884583 msecs"
#2023-01-2718:26jpmonettashi everybody! I'm trying to start a repl in Cursive pointing to a custom version of the Clojure compiler currently on my local mvn repo as clojure-1.12.0-master-SNAPSHOT so I can run Clojure expressions and debug Java code. I added the new compiler version to my deps.edn and the repl is working fine.
My question is how do I attach the clojure sources as an external library so I can jump into java code, debug, etc ?#2023-01-2719:57cflemingAre you adding it in an alias in your deps.edn? If so, selecting that alias in the deps toolwindow (as described here: https://cursive-ide.com/userguide/deps.html#working-with-aliases) then refreshing your project should work.#2023-01-2720:01jpmonettasNo, my deps edn contains just this `
{:deps {org.clojure/clojure {:mvn/version "1.12.0-master-SNAPSHOT"}}}
`#2023-01-2720:02cflemingAnd that doesn’t appear in your external libraries view?#2023-01-2720:02jpmonettasbut then on externali libraries I see this#2023-01-2720:03cflemingHave you refreshed your project since you made the change to add it?#2023-01-2720:03cflemingIf you look in Dependencies in the Deps toolwindow, what does that look like?#2023-01-2720:03jpmonettas> Have you refreshed your project since you made the change to add it?
oh, that did the trick#2023-01-2720:04jpmonettasThanks!!#2023-01-2720:04cflemingGreat, I like an easy fix 🙂#2023-01-3115:16octahedrionis there any way to change the font size in the REPL the way I can for editor windows (with keybindings) ?#2023-01-3122:03cflemingI think Preferences | Editor | Color Scheme | Console Font is what you’re looking for?#2023-02-0107:49octahedrionyes but that's for all REPLs and it's not keybindable#2023-02-0107:53octahedrioni.e. in a normal editor I can do ⌘= to increase font size and ⌘-to decrease it without having to go into preferences, and it's for only that editor pane#2023-02-0118:59kkruitHey all I'm having an issue with my current setup. I'm on windows developing a project in WSL2 but when I try to add my clojure deps project I get a stub execution error because it's trying to use the linux java jdk in windows. I've tried changing the sdk to a windows one but it only shows the linux/wsl ones in the project settings. Any recomendations?#2023-02-0121:18kkruitSo I ended up fixing it by copying my windows jdk to my wsl environment setting that as the sdk running refresh clojure deps projects and then switching my sdk back to the wsl one. Seems like there could be a bug there though.#2023-02-0122:08kkruitthis also seems to still be an issue for me any ideas there?#2023-02-0122:08kkruithttps://github.com/cursive-ide/cursive/issues/394#2023-02-0122:35kkruitI'm currently on version 1.12.7-2022.3 if that's useful#2023-02-0208:55gravWe have a "private" repo defined in our project.clj like so:
:repositories [["private-repo" {:url ""
:username :env/PRIVATE_MVN_USERNAME
:password :env/PRIVATE_MVN_PASSWORD
:sign-releases false
:checksum :fail}]]#2023-02-0208:58gravWhenever I use Refresh Leiningen Projects, I get a dependency resolution error.
Works fine from the cli with lein deps, as long as the env-vars are set up correctly.
So I'm thinking it's related to the missing env vars. Can I somehow get Cursive to resolve those?#2023-02-0308:38grav@U0567Q30W Hope it's okay to ping you (again 😉) - threads get burried pretty quickly here#2023-02-0309:13cflemingIt is! I’ll try to take a look at this over the weekend.#2023-02-0309:13cflemingWhich platform are you on? Getting IntelliJ to see env vars can be a real pain.#2023-02-0309:14gravI'm on Linux. Can also test on Mac#2023-02-0309:15cflemingSo the issue here is that IntelliJ invokes lein in-process to do that operation. That means that IntelliJ itself will have to see those env vars for this to work. Do you know how to make that happen on your distribution?#2023-02-0309:15cflemingDepends how you invoke IntelliJ, I guess.#2023-02-0309:15gravAh, okay, that makes sense. I can try launching IntelliJ from bash and see if it will pick up the env vars 👍#2023-02-0309:15gravAnd if it does then I can probably get my app launcher to pass them on#2023-02-0309:16cflemingLet me know if that doesn’t work.#2023-02-0309:16gravWill do! Thanks for the suggestions 🙏#2023-02-0309:16cflemingNo worries! I was thinking about some way to pass env var values to lein through the UI, but I’m guessing you don’t want to be configuring your secrets in the preferences.#2023-02-0309:17cflemingSo if you can inherit from the environment that’s probably a better solution.#2023-02-0309:18gravWell, it wouldn't be a no-go in this case. I was looking for a place to do that, but I gave up 🤷
It would be nice if it were per-project (like I have .envrc setup per project-dir), not sure if that would be an IntelliJ feature or a Cursive feature?#2023-02-0309:19gravIn any case, it's not a deal-breaker if I need to launch IDEA with those env vars, so I'll look into that first#2023-02-0309:19cflemingSo there’s this: https://github.com/ashald/EnvFile, which I did some work to support a while back. But that’s just for run configs. I’ll see if I can hook into it somehow.#2023-02-0211:07anovickHello friends, I am new to using Cursive.
What action can I use to send an expression to a working REPL in the side pane?#2023-02-0211:14onetomboth#2023-02-0211:15onetomu should put your whole question into a single message next time, so it's easier to respond to it on a thread.
u can also number the options, so we can refer back to it easily in a response.#2023-02-0211:16anovickok#2023-02-0211:16onetomhttps://cursive-ide.com/userguide/repl.html#interaction-with-the-editor#2023-02-0211:16onetomhere u can find some animations showing how these operations work#2023-02-0211:17onetomif i remember correctly#2023-02-0211:18anovickWhat is the difference between the two actions?#2023-02-0211:18anovickwhat does Top form mean?#2023-02-0211:19onetomi usually just use the "Send top form to REPL", because i can be in the middle of a deeply nested expression and it would still evaluate the whole expression up to the top-level of the file (or to the (comment ...) expression containing it)#2023-02-0211:19anovickoh#2023-02-0211:19anovickI see now#2023-02-0211:19anovickmakes sense#2023-02-0211:20onetomtop-form means, it's not within some other expression.
a (comment ...) expression is an exception though. everything within it is still considered top-level#2023-02-0211:22onetomif u leave expressions within a (comment ...) in your source code, those are referred to as "Rich comments", because Rich Hickey popularized this tactic.
u can provide examples of how to use adjacent code within such blocks or show the REPL session of the thinking process, which lead to a specific implementation.#2023-02-0211:22anovickoh haha that's interesting#2023-02-0211:07anovickthanks :hugging_face:#2023-02-0211:09anovickis that "Send top form to REPL" ?#2023-02-0211:09anovickor "Send Form before Caret to REPL"#2023-02-0211:21anovickI just learned I can go to implementation code with the action "Go to implementation"
is there a way to return back to the file where I called this action from?#2023-02-0211:22onetomyes, with cmd-opt-left#2023-02-0211:23anovickoh that's great but do you know what action this is?#2023-02-0211:23anovickor maybe I can look up in keymaps#2023-02-0211:23onetomit's the Navigate / Back action in the menu#2023-02-0211:23anovickoh#2023-02-0211:23onetomu can look up actions based on their keyboard shortcuts too btw#2023-02-0211:24anovickworked#2023-02-0211:24onetomif u hop on this screen sharing session, i can show u around
https://pop.com/j/895-310-241#2023-02-0211:24anovickthis is sweet 🙂#2023-02-0211:24onetomi have ~30 mins to help, if u want#2023-02-0211:24anovickyou're very generous#2023-02-0211:25anovickcan I use this opportunity another time perhaps when you're available?#2023-02-0211:25anovickI have other obligations to attend to at this hour...#2023-02-0211:25onetomsure. i live in GMT+8 and i usually have some time around this hour#2023-02-0211:25onetomjust DM me to see if im available#2023-02-0211:26anovickvery happy to receive your kind attention 🙂 thanks and have a great day#2023-02-0211:26onetomi love to help with the workflow, because that can make ppl a loooot lot more effective at learning clojure.
they can focus on the meat of the language and the std lib, instead of fighting with the tooling.#2023-02-0211:27anovickyea it's hard to set everything up! glad to have people like you around to help out#2023-02-0211:27onetomvery little effort at the beginning can save tremendous amount of pain later, so i think it makes a lot of sense to help ppl out, so there can be more clojure programmers out there 🙂#2023-02-0211:28anovickdefinitely appreciated#2023-02-0211:29onetomwell, see u later then, when u have more time!
but keep asking in the meantime and also read thru the official cursive users manual, because it's pretty good and relatively short too.#2023-02-0211:29anovickwill do.
take care :hugging_face:#2023-02-0211:32onetomalso https://clojure.org/guides/getting_started is pretty useful
im still referring to it after almost a decade of using clojure, because it's getting extended with docs about newer features, like tools.build#2023-02-0211:37onetomdoes anyone have a list of ALL Cursive menu items in markdown format?
it would be helpful to help others out faster, because we can just copy-paste things, like
`Main Menu` / `Tools` / `REPL` / `Send Form Before Caret to REPL
`
because we can just full-text search such a file.#2023-02-0222:39cflemingThis is actually trickier to generate than you might think. However I do generate a similar list as part of my documentation generation. I could potentially create a doc page containing this, as well as the settings.#2023-02-0305:05onetomi didn't say generate, just asked if anyone has a list 🙂
if no one has, i will just start typing up a list as need arises#2023-02-0309:12cflemingTrue, but after maintaining my doc by hand for ages, whenever I hear anything like that, I immediately think: generate, don’t maintain by hand 🙂. I’ll see if I can get that into the doc.#2023-02-0211:39onetomsimilarly a file for the various cursive / clojure preferences would be helpful too, so it's easier to put together a documentation for company-specific, recommended settings#2023-02-0211:40onetomfor example, we have a Notion page like this now#2023-02-0211:42onetomi have to say, that emacs is better in this respect, because i could communicate a set of settings via a trivial program, which sets customization or regular variables, regardless of the categorization (because the setting category is already encoded in the setting name)#2023-02-0211:50anovickI'm not sure why but "Send Form Before Caret to REPL" key binding doesn't seem to work for me
I also don't have this action listed in "Find Action" menu#2023-02-0212:48onetomu have to have some expression before your caret.
if u r inside some symbol, string or keyword, then there is no complete form before the caret#2023-02-0212:50onetommaybe u can think of this operation as "(the previous complete) form left of the cursor or above the cursor, if there are only spaces left of it"#2023-02-0212:58onetomCIDER for Emacs has a cider-eval-last-sexp operation and explains last-sexp as:
> the form preceding the cursor
— https://docs.cider.mx/cider/usage/code_evaluation.html#2023-02-0213:04onetomthere is a "form before caret" if the cursor - shown as • - is at the following positions:
(prn• "asd") 123
(prn "asd"•) 123
(prn "asd")• 123
(prn "asd") • 123
but u the form before caret is deemed ambiguous, if the cursor is in the following positions:
(pr•n "asd") 123
(prn •"asd") 123
(prn "as•d") 123
(prn "asd") •123
(prn "asd") 12•3
so u won't have the Send Form Before Caret to REPL operation available#2023-02-0213:10onetomat the beginning, i recommend to use the Opt-Up/Down aka Extend / Shrink Selection commands to see where the expression boundaries are, until u can see it without explicit selection too.#2023-02-0213:11onetomand when u have already selected some valid and complete forms with these commands, u can use either Send ... to REPL operations to evaluate that selection.#2023-02-0213:13onetomthis way u can even ignore the Send Form Before Caret to REPL commands and always just use the Send Top Form to REPL with or without a selection.
it would 2 multiple keystrokes, but since it's a rarely needed operation, it might worth using it, since it requires a simpler mental model.#2023-02-0218:57anovick@U086D6TBN that's so awesome#2023-02-0218:58anovick#2023-02-0305:06onetomMVP? Minimal Viable Product? 🙂#2023-02-0216:12Rachel WestmacottWould it be possible for REPL configurations to come pre-populated with the selected aliases in a deps.edn project? I have to select the aliases I'm using in the 'Clojure Deps' pane to make the IDE understand my project, and then I also have to specify them in the run configuration for the REPL to make my REPL work. It would be great if Cursive did something clever here (though I confess I've not thought through the consequences), even if it just pre-filled the currently selected aliases at the time you create the run REPL configuration.#2023-02-0222:33cflemingThe issue that I can think of is that for syncing aliases to a project I usually use the superset of all aliases I might want, to ensure that all the sources are available. For example, you might not want your test alias enabled in your REPL, but you definitely want it for editing.#2023-02-0909:26Rachel WestmacottIt's rare that i don't want the test alias enabled in my REPL - or at least I see no harm in having the source on the classpath, but it would be nice not to have the :main-opts. This clearly relates to the other thread: https://clojurians.slack.com/archives/C0744GXCJ/p1675354446280009#2023-02-0216:14Rachel WestmacottOn the subject of REPLs and deps.edn files, it would also be nice if the REPL run configurations ignored the :main-opts of the specified aliases. If you're running a REPL I can't imagine them being useful.#2023-02-0222:36cflemingSo I recently fixed this (or broke it, depending on your point of view). See https://github.com/cursive-ide/cursive/issues/2322 for some discussion.#2023-02-0816:31cap10morganI switch those to :exec-fn to solve that issue. And I assumed that was (part of) the motivation for that feature in tools.deps? But it's not a drop-in replacement.#2023-02-0218:59anovickJust learned I can make my parens rainbow colored 😮
and also I can separate the REPL outputs 🤯
man I'm having so much fun with this#2023-02-0219:04kennytiltonWe call this "the Lisp curse". It's so much fun we forget to do the work intended.#2023-02-0309:09cfleminghttps://twitter.com/CursiveIDE/status/1621435555119792128#2023-02-0311:34onetomwe tried it quickly for an hour and seemed to work flawlessly so far!#2023-02-0311:54kennytiltonHmm, I recall an option to include EAPs, but not finding it in the IntelliJ Plugins interface. Do I have to uninstall and reinstall or sth? I'll check the Cursive doc itself.#2023-02-0312:07kennytiltonAh, all set. I switched to IJ EAP. (Duh.)#2023-02-0319:47salamApparently, [Option - ⬆️] is my favorite keyboard shortcut. What’s yours? 🙂 #2023-02-0323:06cflemingIt’s mine as well, but I complete code much more than you :-)#2023-02-0407:40thhellerthat seems to be grouped incorrectly? I have never used that and its still in my top3? or is that just "any" syntax aware selection and the example just happens to be one I don't use?#2023-02-0408:16cflemingSyntax aware selection is the Alt-up, which expands the selection by semantic units.#2023-02-0408:17thhellerI don't use that though 😛#2023-02-0410:12imreWhat is this dialog? Never saw it#2023-02-0411:07thhellerhelp -> my productivity#2023-02-0502:34Tom H.oh wow I was not aware of alt-up, that’s amazing#2023-02-0502:34Tom H.here’s mine#2023-02-0502:37Tom H.recent files popup is a great one I hadn’t used either, I need to learn more hotkeys 😄#2023-02-0508:19cflemingTime to read the doc! https://cursive-ide.com/userguide/navigation.html#2023-02-0802:56onetomThese are my stats in the EAP version#2023-02-0802:56onetomRelease version#2023-02-0803:00onetomstructural editing commands doesn't seem to be counted in these stats.
those would be an interesting metric from cursive perspective, imho.#2023-02-0815:13steveb8nQ: does the organise imports command support cljc or is that too hard?#2023-02-0902:00cflemingCurrently, it will work on CLJC (modulo one bug: https://github.com/cursive-ide/cursive/issues/2724), but it will skip clauses that are too hard. I’m also planning to improve this soon.#2023-02-0902:31steveb8nHappy days. I'll give it a whirl#2023-02-0902:05cfleminghttps://twitter.com/CursiveIDE/status/1623503156310335488#2023-02-0903:50caleb.macdonaldblackWow. Love these changes!